Fix size check bug in icon setting. Divide by four to get the size of the buffer in pixels.

This commit is contained in:
Kevin Glass 2005-07-10 20:15:55 +00:00
parent 2147b530b3
commit ce83d997bf
2 changed files with 2 additions and 2 deletions

View file

@ -452,7 +452,7 @@ final class LinuxDisplay implements DisplayImplementation {
*/
public int setIcon(ByteBuffer[] icons) {
for (int i=0;i<icons.length;i++) {
int size = icons[i].limit();
int size = icons[i].limit() / 4;
if (((int) Math.sqrt(size)) == 32) {
nSetWindowIcon(icons[i]);

View file

@ -176,7 +176,7 @@ final class Win32Display implements DisplayImplementation {
int used = 0;
for (int i=0;i<icons.length;i++) {
int size = icons[i].limit();
int size = icons[i].limit() / 4;
if ((((int) Math.sqrt(size)) == 16) && (!done16)) {
nSetWindowIcon16(icons[i].asIntBuffer());