mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
Fixed issues when creating leaded components using drag and drop with
'Snap to Grid' option switched on using a metric grid spacing (e.g. 1mm)
This commit is contained in:
@@ -52,6 +52,7 @@ import org.diylc.core.annotations.EditableProperty;
|
||||
import org.diylc.core.annotations.PositiveNonZeroMeasureValidator;
|
||||
import org.diylc.core.measures.Size;
|
||||
import org.diylc.core.measures.SizeUnit;
|
||||
import org.diylc.presenter.CalcUtils;
|
||||
import org.diylc.utils.Constants;
|
||||
|
||||
/**
|
||||
@@ -102,6 +103,13 @@ public abstract class AbstractLeadedComponent<T> extends AbstractTransparentComp
|
||||
}
|
||||
points[2] = calculateLabelPosition(points[0], points[1]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createdIn(Project project) {
|
||||
double targetSize = CalcUtils.findClosestMultiplierOf(project.getGridSpacing(), DEFAULT_SIZE, 2).convertToPixels();
|
||||
points[0]= new Point2D.Double(-targetSize / 2, 0);
|
||||
points[1] = new Point2D.Double(targetSize / 2, 0);
|
||||
}
|
||||
|
||||
protected boolean IsCopperArea() {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user