mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
In cases when there's already a component in the selection that is
reduced to nothing, allow moving the selection
This commit is contained in:
@@ -1359,7 +1359,17 @@ public class Presenter implements IPlugInPort {
|
|||||||
|
|
||||||
// Validate if moving can be done.
|
// Validate if moving can be done.
|
||||||
for (Map.Entry<IDIYComponent<?>, Set<Integer>> entry : controlPointMap.entrySet()) {
|
for (Map.Entry<IDIYComponent<?>, Set<Integer>> entry : controlPointMap.entrySet()) {
|
||||||
|
// check if a component already has overlapping points because of a previous error, in that case skip it
|
||||||
|
boolean skip = false;
|
||||||
IDIYComponent<?> component = entry.getKey();
|
IDIYComponent<?> component = entry.getKey();
|
||||||
|
for (int i = 0; i < component.getControlPointCount() - 1 && !skip; i++)
|
||||||
|
for (int j = i + 1; j < component.getControlPointCount() && !skip; j++)
|
||||||
|
if (component.getControlPoint(i).equals(component.getControlPoint(j)))
|
||||||
|
skip = true;
|
||||||
|
|
||||||
|
if (skip)
|
||||||
|
continue;
|
||||||
|
|
||||||
Point2D[] controlPoints = new Point2D[component.getControlPointCount()];
|
Point2D[] controlPoints = new Point2D[component.getControlPointCount()];
|
||||||
for (int index = 0; index < component.getControlPointCount(); index++) {
|
for (int index = 0; index < component.getControlPointCount(); index++) {
|
||||||
Point2D p = component.getControlPoint(index);
|
Point2D p = component.getControlPoint(index);
|
||||||
|
|||||||
@@ -3302,6 +3302,10 @@
|
|||||||
<changeType>IMPROVEMENT</changeType>
|
<changeType>IMPROVEMENT</changeType>
|
||||||
<description>Do not allow for components like traces, jumpers and wires to be reduced to nothing by dragging connected components</description>
|
<description>Do not allow for components like traces, jumpers and wires to be reduced to nothing by dragging connected components</description>
|
||||||
</org.diylc.appframework.update.Change>
|
</org.diylc.appframework.update.Change>
|
||||||
|
<org.diylc.appframework.update.Change>
|
||||||
|
<changeType>IMPROVEMENT</changeType>
|
||||||
|
<description>In cases when there's already a component in the selection that is reduced to nothing, allow moving the selection</description>
|
||||||
|
</org.diylc.appframework.update.Change>
|
||||||
</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>
|
||||||
|
|||||||
Reference in New Issue
Block a user