From c1eb0be0680680996ad8230ca83d55eee0b1722a Mon Sep 17 00:00:00 2001 From: lukflug Date: Sat, 24 Apr 2021 20:24:40 +0200 Subject: [PATCH] Small fix --- .../com/lukflug/panelstudio/widget/ResizableComponent.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/panelstudio/src/main/java/com/lukflug/panelstudio/widget/ResizableComponent.java b/panelstudio/src/main/java/com/lukflug/panelstudio/widget/ResizableComponent.java index 89d51a6..6815e0b 100644 --- a/panelstudio/src/main/java/com/lukflug/panelstudio/widget/ResizableComponent.java +++ b/panelstudio/src/main/java/com/lukflug/panelstudio/widget/ResizableComponent.java @@ -69,8 +69,7 @@ public int getHeight (int height) { @Override public Context getContext (Context context) { if (resizing[0]) { - Point p=getComponent().getPosition(context.getInterface()); - getComponent().setPosition(context.getInterface(),new Point(p.x,p.y+context.getInterface().getMouse().y-attachPoint.y)); + getComponent().setPosition(context.getInterface(),new Point(attachRect.x,attachRect.y+context.getInterface().getMouse().y-attachPoint.y)); size.setSize(new Dimension(attachRect.width,attachRect.height-context.getInterface().getMouse().y+attachPoint.y)); } else if (resizing[1]) { size.setSize(new Dimension(attachRect.width,attachRect.height+context.getInterface().getMouse().y-attachPoint.y)); @@ -82,9 +81,7 @@ public Context getContext (Context context) { } else if (resizing[3]) { size.setSize(new Dimension(attachRect.width+context.getInterface().getMouse().x-attachPoint.x,attachRect.height)); } - Point p=context.getPos(); - p.translate(renderer.getBorder(),renderer.getBorder()); - return new Context(context,context.getSize().width-2*renderer.getBorder(),p,true,true); + return new Context(context,context.getSize().width-2*renderer.getBorder(),new Point(renderer.getBorder(),renderer.getBorder()),true,true); } @Override