@Override public void convertToBacking (GLCanvas canvas, Rectangle bounds) { // the below is the way we're *supposed* to handle Retina displays, but for whatever unknown // reason it just returns a 1x size regardless of the actual backing scale // NSSize backingSize = new NSSize(); // backingSize.width = bounds.width; // backingSize.height = bounds.height; // convertSizeToBacking(canvas.view, backingSize); // so instead we use the deprecated API above (getting the screen backing scale factor) and // then forcibly apply that to the bounds bounds.width = FloatMath.iceil(bounds.width * screenScale); bounds.height = FloatMath.iceil(bounds.height * screenScale); } }
@Override public void convertToBacking (GLCanvas canvas, Rectangle bounds) { // the below is the way we're *supposed* to handle Retina displays, but for whatever unknown // reason it just returns a 1x size regardless of the actual backing scale // NSSize backingSize = new NSSize(); // backingSize.width = bounds.width; // backingSize.height = bounds.height; // convertSizeToBacking(canvas.view, backingSize); // so instead we use the deprecated API above (getting the screen backing scale factor) and // then forcibly apply that to the bounds bounds.width = FloatMath.iceil(bounds.width * screenScale); bounds.height = FloatMath.iceil(bounds.height * screenScale); } }