mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
Do not allow creating zero-length components
This commit is contained in:
@@ -503,6 +503,10 @@ public class Presenter implements IPlugInPort {
|
|||||||
// On the second click, add the component to the
|
// On the second click, add the component to the
|
||||||
// project.
|
// project.
|
||||||
List<IDIYComponent<?>> componentSlot = instantiationManager.getComponentSlot();
|
List<IDIYComponent<?>> componentSlot = instantiationManager.getComponentSlot();
|
||||||
|
Point firstPoint = componentSlot.get(0).getControlPoint(0);
|
||||||
|
// don't allow to create component with the same points
|
||||||
|
if (scaledPoint.equals(firstPoint))
|
||||||
|
return;
|
||||||
componentSlot.get(0).setControlPoint(scaledPoint, 1);
|
componentSlot.get(0).setControlPoint(scaledPoint, 1);
|
||||||
List<IDIYComponent<?>> newSelection = new ArrayList<IDIYComponent<?>>();
|
List<IDIYComponent<?>> newSelection = new ArrayList<IDIYComponent<?>>();
|
||||||
for (IDIYComponent<?> component : componentSlot) {
|
for (IDIYComponent<?> component : componentSlot) {
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ import org.diylc.common.IPlugInPort;
|
|||||||
import org.diylc.common.ObjectCache;
|
import org.diylc.common.ObjectCache;
|
||||||
import org.diylc.common.Orientation;
|
import org.diylc.common.Orientation;
|
||||||
import org.diylc.components.AbstractTransparentComponent;
|
import org.diylc.components.AbstractTransparentComponent;
|
||||||
import org.diylc.components.misc.Label;
|
|
||||||
import org.diylc.components.transform.DIL_ICTransformer;
|
import org.diylc.components.transform.DIL_ICTransformer;
|
||||||
import org.diylc.core.ComponentState;
|
import org.diylc.core.ComponentState;
|
||||||
import org.diylc.core.IDIYComponent;
|
import org.diylc.core.IDIYComponent;
|
||||||
|
|||||||
@@ -1654,6 +1654,10 @@
|
|||||||
<changeType>NEW_FEATURE</changeType>
|
<changeType>NEW_FEATURE</changeType>
|
||||||
<description>Ability to set project-wide default font through 'Edit Project Settings' dialog.</description>
|
<description>Ability to set project-wide default font through 'Edit Project Settings' dialog.</description>
|
||||||
</org.diylc.appframework.update.Change>
|
</org.diylc.appframework.update.Change>
|
||||||
|
<org.diylc.appframework.update.Change>
|
||||||
|
<changeType>IMPROVEMENT</changeType>
|
||||||
|
<description>Do not allow creating zero-length components (i.e. traces, lines, etc)</description>
|
||||||
|
</org.diylc.appframework.update.Change>
|
||||||
<org.diylc.appframework.update.Change>
|
<org.diylc.appframework.update.Change>
|
||||||
<changeType>IMPROVEMENT</changeType>
|
<changeType>IMPROVEMENT</changeType>
|
||||||
<description>Hookup wire can be sent to back behind boards</description>
|
<description>Hookup wire can be sent to back behind boards</description>
|
||||||
|
|||||||
Reference in New Issue
Block a user