mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-154396 Floating tool window resize incorrect with Windows taskbar on the left
the screen size is not equal to max coordinates if top/left insets are not zero
This commit is contained in:
@@ -221,9 +221,11 @@ public final class FloatingDecorator extends JDialog {
|
||||
final Point newPoint=e.getPoint();
|
||||
SwingUtilities.convertPointToScreen(newPoint,this);
|
||||
final Rectangle screenBounds=WindowManagerEx.getInstanceEx().getScreenBounds();
|
||||
int screenMaxX = screenBounds.x + screenBounds.width;
|
||||
int screenMaxY = screenBounds.y + screenBounds.height;
|
||||
|
||||
newPoint.x=Math.min(Math.max(newPoint.x,screenBounds.x),screenBounds.width);
|
||||
newPoint.y=Math.min(Math.max(newPoint.y,screenBounds.y),screenBounds.height);
|
||||
newPoint.x = Math.min(Math.max(newPoint.x, screenBounds.x), screenMaxX);
|
||||
newPoint.y = Math.min(Math.max(newPoint.y, screenBounds.y), screenMaxY);
|
||||
|
||||
final Rectangle oldBounds=FloatingDecorator.this.getBounds();
|
||||
final Rectangle newBounds=new Rectangle(oldBounds);
|
||||
@@ -248,16 +250,16 @@ public final class FloatingDecorator extends JDialog {
|
||||
}
|
||||
if((myMotionMask&ANCHOR_BOTTOM)>0){
|
||||
newPoint.y=Math.max(newPoint.y,oldBounds.y+2*DIVIDER_WIDTH);
|
||||
if(newPoint.y>screenBounds.height-DIVIDER_WIDTH){
|
||||
newPoint.y=screenBounds.height;
|
||||
if (newPoint.y > screenMaxY - DIVIDER_WIDTH) {
|
||||
newPoint.y = screenMaxY;
|
||||
}
|
||||
final Point offset=new Point(newPoint.x-myLastPoint.x,newPoint.y-myLastPoint.y);
|
||||
newBounds.height=oldBounds.height+offset.y;
|
||||
}
|
||||
if((myMotionMask&ANCHOR_RIGHT)>0){
|
||||
newPoint.x=Math.max(newPoint.x,oldBounds.x+2*DIVIDER_WIDTH);
|
||||
if(newPoint.x>screenBounds.width-DIVIDER_WIDTH){
|
||||
newPoint.x=screenBounds.width;
|
||||
if (newPoint.x > screenMaxX - DIVIDER_WIDTH) {
|
||||
newPoint.x = screenMaxX;
|
||||
}
|
||||
final Point offset=new Point(newPoint.x-myLastPoint.x,newPoint.y-myLastPoint.y);
|
||||
newBounds.width=oldBounds.width+offset.x;
|
||||
|
||||
Reference in New Issue
Block a user