mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IJPL-162777 Fix frame dimensions
was broken in commit "IJPL-162415 Fix scale" GitOrigin-RevId: 55725da55dfc868720ea34e7f8fe76ac41c1b510
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ddcb403606
commit
3fe67ae091
@@ -116,7 +116,10 @@ class JBCefNativeOsrHandler extends JBCefOsrHandler implements CefNativeRenderHa
|
||||
@Override
|
||||
protected Dimension getCurrentFrameSize() {
|
||||
SharedMemory.WithRaster frame = myCurrentFrame;
|
||||
return frame == null ? null : new Dimension(frame.getWidth(), frame.getHeight());
|
||||
if (frame == null)
|
||||
return null;
|
||||
|
||||
return new Dimension((int)Math.ceil(frame.getWidth()/getPixelDensity()), (int)Math.ceil(frame.getHeight()/getPixelDensity()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -291,12 +291,7 @@ class JBCefOsrHandler implements CefRenderHandler {
|
||||
}
|
||||
|
||||
private VolatileImage createVolatileImage(Graphics2D g, int width, int height) {
|
||||
VolatileImage volatileImage = myVolatileImage;
|
||||
int scaledWidth = (int)Math.floor(width/getPixelDensity());
|
||||
int scaledHeight = (int)Math.floor(height/getPixelDensity());
|
||||
if (width % getPixelDensity() != 0) ++scaledWidth;
|
||||
if (height % getPixelDensity() != 0) ++scaledHeight;
|
||||
VolatileImage image = g.getDeviceConfiguration().createCompatibleVolatileImage(scaledWidth, scaledHeight, Transparency.TRANSLUCENT);
|
||||
VolatileImage image = g.getDeviceConfiguration().createCompatibleVolatileImage(width, height, Transparency.TRANSLUCENT);
|
||||
|
||||
{// clear image
|
||||
Graphics2D gimg = (Graphics2D)image.getGraphics().create();
|
||||
|
||||
Reference in New Issue
Block a user