mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
do not show control points of non-stretchable
This commit is contained in:
+7
-1
@@ -455,7 +455,8 @@ public class Presenter implements IPlugInPort {
|
|||||||
IDIYComponent<?> component = currentProject.getComponents().get(i);
|
IDIYComponent<?> component = currentProject.getComponents().get(i);
|
||||||
for (int pointIndex = 0; pointIndex < component.getControlPointCount(); pointIndex++) {
|
for (int pointIndex = 0; pointIndex < component.getControlPointCount(); pointIndex++) {
|
||||||
Point controlPoint = component.getControlPoint(pointIndex);
|
Point controlPoint = component.getControlPoint(pointIndex);
|
||||||
if (shouldShowControlPointsFor(component)) {
|
// Only consider selected components.
|
||||||
|
if (selectedComponents.contains(component)) {
|
||||||
try {
|
try {
|
||||||
if (scaledPoint.distance(controlPoint) < CONTROL_POINT_SENSITIVITY) {
|
if (scaledPoint.distance(controlPoint) < CONTROL_POINT_SENSITIVITY) {
|
||||||
Set<Integer> indices = new HashSet<Integer>();
|
Set<Integer> indices = new HashSet<Integer>();
|
||||||
@@ -820,6 +821,11 @@ public class Presenter implements IPlugInPort {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean shouldShowControlPointsFor(IDIYComponent<?> component) {
|
private boolean shouldShowControlPointsFor(IDIYComponent<?> component) {
|
||||||
|
ComponentType componentType = componentTypeMap.get(component.getClass());
|
||||||
|
// Do not show control points for non-stretchable components.
|
||||||
|
if (!componentType.isStretchable()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return selectedComponents.contains(component);
|
return selectedComponents.contains(component);
|
||||||
// return
|
// return
|
||||||
// controlPoint.getVisibilityPolicy().equals(VisibilityPolicy.ALWAYS)
|
// controlPoint.getVisibilityPolicy().equals(VisibilityPolicy.ALWAYS)
|
||||||
|
|||||||
Reference in New Issue
Block a user