< prev index next >
src/java.desktop/windows/classes/sun/awt/windows/WWindowPeer.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 400,413 ****
Dimension minimumSize = null;
if (((Component)target).isMinimumSizeSet()) {
minimumSize = ((Component)target).getMinimumSize();
}
if (minimumSize != null) {
! int msw = getSysMinWidth();
! int msh = getSysMinHeight();
! int w = (minimumSize.width >= msw) ? minimumSize.width : msw;
! int h = (minimumSize.height >= msh) ? minimumSize.height : msh;
setMinSize(w, h);
} else {
setMinSize(0, 0);
}
}
--- 400,411 ----
Dimension minimumSize = null;
if (((Component)target).isMinimumSizeSet()) {
minimumSize = ((Component)target).getMinimumSize();
}
if (minimumSize != null) {
! int w = Math.max(minimumSize.width, scaleDownX(getSysMinWidth()));
! int h = Math.max(minimumSize.height, scaleDownY(getSysMinHeight()));
setMinSize(w, h);
} else {
setMinSize(0, 0);
}
}
*** 685,694 ****
--- 683,708 ----
scaleX = (float) tx.getScaleX();
scaleY = (float) tx.getScaleY();
}
}
+ final int scaleUpX(int x) {
+ return Region.clipRound(x * scaleX);
+ }
+
+ final int scaleUpY(int y) {
+ return Region.clipRound(y * scaleY);
+ }
+
+ final int scaleDownX(int x) {
+ return Region.clipRound(x / scaleX);
+ }
+
+ final int scaleDownY(int y) {
+ return Region.clipRound(y / scaleY);
+ }
+
@Override
public void print(Graphics g) {
// We assume we print the whole frame,
// so we expect no clip was set previously
Shape shape = ((Window)target).getShape();
< prev index next >