mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 09:12:09 +10:00
redo relaxed validation
This commit is contained in:
@@ -1258,15 +1258,15 @@ public class Presenter implements IPlugInPort {
|
||||
}
|
||||
}
|
||||
|
||||
// for (int i = 0; i < controlPoints.length - 1; i++) {
|
||||
// for (int j = i + 1; j < controlPoints.length; j++) {
|
||||
// if (controlPoints[i] != null && controlPoints[j] != null && controlPoints[i].equals(controlPoints[j])) {
|
||||
// // Control points collision detected, cannot make
|
||||
// // this move.
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
for (int i = 0; i < controlPoints.length - 1; i++) {
|
||||
for (int j = i + 1; j < controlPoints.length; j++) {
|
||||
if (controlPoints[i] != null && controlPoints[j] != null && controlPoints[i].equals(controlPoints[j])) {
|
||||
// Control points collision detected, cannot make
|
||||
// this move.
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Update all points to new location.
|
||||
|
||||
@@ -263,6 +263,11 @@ public abstract class Abstract3LegSymbol extends AbstractComponent<String> {
|
||||
@Override
|
||||
public boolean canPointMoveFreely(int pointIndex) {
|
||||
return pointIndex == 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canControlPointOverlap(int index) {
|
||||
return index >= 3;
|
||||
}
|
||||
|
||||
@EditableProperty
|
||||
|
||||
@@ -536,6 +536,11 @@ public abstract class AbstractLeadedComponent<T> extends AbstractTransparentComp
|
||||
public VisibilityPolicy getControlPointVisibilityPolicy(int index) {
|
||||
return getMoveLabel() || index < 2 ? VisibilityPolicy.ALWAYS : VisibilityPolicy.NEVER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canControlPointOverlap(int index) {
|
||||
return index >= 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setControlPoint(Point point, int index) {
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user