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