mirror of
https://github.com/shadowfacts/lwjgl2-arm64.git
synced 2026-01-05 16:29:57 +01:00
Fix size check bug in icon setting. Divide by four to get the size of the buffer in pixels.
This commit is contained in:
parent
2147b530b3
commit
ce83d997bf
|
|
@ -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]);
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Reference in a new issue