mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
"Snap to Components" features now works when creating new components as well as when moving existing ones
This commit is contained in:
@@ -894,6 +894,8 @@ public class Presenter implements IPlugInPort {
|
|||||||
if (instantiationManager.getComponentTypeSlot() != null) {
|
if (instantiationManager.getComponentTypeSlot() != null) {
|
||||||
if (isSnapToGrid()) {
|
if (isSnapToGrid()) {
|
||||||
CalcUtils.snapPointToGrid(previousScaledPoint, currentProject.getGridSpacing());
|
CalcUtils.snapPointToGrid(previousScaledPoint, currentProject.getGridSpacing());
|
||||||
|
} else if (isSnapToObjects()) {
|
||||||
|
CalcUtils.snapPointToObjects(previousScaledPoint, currentProject.getGridSpacing(), null, currentProject.getComponents());
|
||||||
}
|
}
|
||||||
boolean refresh = false;
|
boolean refresh = false;
|
||||||
switch (instantiationManager.getComponentTypeSlot().getCreationMethod()) {
|
switch (instantiationManager.getComponentTypeSlot().getCreationMethod()) {
|
||||||
|
|||||||
@@ -4053,5 +4053,21 @@
|
|||||||
</changes>
|
</changes>
|
||||||
<url>https://github.com/bancika/diy-layout-creator/releases</url>
|
<url>https://github.com/bancika/diy-layout-creator/releases</url>
|
||||||
</org.diylc.appframework.update.Version>
|
</org.diylc.appframework.update.Version>
|
||||||
|
<org.diylc.appframework.update.Version>
|
||||||
|
<versionNumber>
|
||||||
|
<major>4</major>
|
||||||
|
<minor>31</minor>
|
||||||
|
<build>0</build>
|
||||||
|
</versionNumber>
|
||||||
|
<releaseDate>2022-10-23 00:00:00.000 CET</releaseDate>
|
||||||
|
<name></name>
|
||||||
|
<changes>
|
||||||
|
<org.diylc.appframework.update.Change>
|
||||||
|
<changeType>IMPROVEMENT</changeType>
|
||||||
|
<description>"Snap to Components" features now works when creating new components as well as when moving existing ones</description>
|
||||||
|
</org.diylc.appframework.update.Change>
|
||||||
|
</changes>
|
||||||
|
<url>https://github.com/bancika/diy-layout-creator/releases</url>
|
||||||
|
</org.diylc.appframework.update.Version>
|
||||||
</a>
|
</a>
|
||||||
</java.util.Arrays_-ArrayList>
|
</java.util.Arrays_-ArrayList>
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ import org.diylc.core.IDIYComponent;
|
|||||||
import org.diylc.core.Template;
|
import org.diylc.core.Template;
|
||||||
import org.diylc.core.measures.Size;
|
import org.diylc.core.measures.Size;
|
||||||
import org.diylc.core.measures.SizeUnit;
|
import org.diylc.core.measures.SizeUnit;
|
||||||
|
import org.diylc.presenter.Presenter;
|
||||||
import org.diylc.swing.ActionFactory;
|
import org.diylc.swing.ActionFactory;
|
||||||
import org.diylc.swing.ISwingUI;
|
import org.diylc.swing.ISwingUI;
|
||||||
import org.diylc.swing.gui.TranslatedMenu;
|
import org.diylc.swing.gui.TranslatedMenu;
|
||||||
@@ -423,7 +424,7 @@ public class CanvasPlugin implements IPlugIn, ClipboardOwner {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void unitsChanged(boolean isMetric) {
|
public void unitsChanged(boolean isMetric) {
|
||||||
plugInPort.setMetric(isMetric);
|
configManager.writeValue(Presenter.METRIC_KEY, isMetric);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user