mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
Fixed the issue with 'Add Flexible Leads' functionality placing the flexible leads wrong on leaded components (e.g. resistors, capacitors...)
This commit is contained in:
@@ -471,8 +471,6 @@ public class CanvasPlugin implements IPlugIn, ClipboardOwner {
|
||||
public void zoom(int direction) {
|
||||
Point mousePosBefore = canvasPanel.getMousePosition(true);
|
||||
Point locationBefore = canvasPanel.getLocation();
|
||||
int relativeX = (int) (mousePosBefore.getX() + locationBefore.getX());
|
||||
int relativeY = (int) (mousePosBefore.getY() + locationBefore.getY());
|
||||
|
||||
// change zoom level
|
||||
double oldZoom = plugInPort.getZoomLevel();
|
||||
@@ -504,6 +502,8 @@ public class CanvasPlugin implements IPlugIn, ClipboardOwner {
|
||||
|
||||
if (selectionBounds == null) {
|
||||
// center to cursor
|
||||
int relativeX = (int) (mousePosBefore.getX() + locationBefore.getX());
|
||||
int relativeY = (int) (mousePosBefore.getY() + locationBefore.getY());
|
||||
Point desiredPos = new Point((int) (1d * mousePosBefore.getX() / oldZoom * newZoom),
|
||||
(int) (1d * mousePosBefore.getY() / oldZoom * newZoom));
|
||||
int newHorizontalPos = (int) (desiredPos.getX() - relativeX);
|
||||
|
||||
Reference in New Issue
Block a user