invalidate continuity area on move/edit

This commit is contained in:
bancika
2020-03-27 11:35:31 +01:00
parent 32eb3a366a
commit 55ab31f8e2
2 changed files with 17 additions and 7 deletions
@@ -1297,14 +1297,18 @@ public class Presenter implements IPlugInPort {
// Update all points to new location.
for (Map.Entry<IDIYComponent<?>, Set<Integer>> entry : controlPointMap.entrySet()) {
IDIYComponent<?> c = entry.getKey();
drawingManager.invalidateComponent(c);
IDIYComponent<?> c = entry.getKey();
for (Integer index : entry.getValue()) {
Point p = new Point(c.getControlPoint(index));
p.translate(actualDx, actualDy);
c.setControlPoint(p, index);
}
}
// Remove from area map.
drawingManager.clearComponentAreaMap();
drawingManager.clearContinuityArea();
return new Point(actualDx, actualDy);
}
@@ -1349,11 +1353,14 @@ public class Presenter implements IPlugInPort {
ComponentType type =
ComponentProcessor.getInstance().extractComponentTypeFrom(
(Class<? extends IDIYComponent<?>>) component.getClass());
if (type.getTransformer() != null && type.getTransformer().canRotate(component)) {
drawingManager.invalidateComponent(component);
if (type.getTransformer() != null && type.getTransformer().canRotate(component)) {
type.getTransformer().rotate(component, center, direction);
}
}
// Remove from area map.
drawingManager.clearComponentAreaMap();
drawingManager.clearContinuityArea();
// AffineTransform rotate = AffineTransform.getRotateInstance(Math.PI / 2 * direction, center.x,
// center.y);
@@ -1462,12 +1469,15 @@ public class Presenter implements IPlugInPort {
for (IDIYComponent<?> component : components) {
ComponentType type =
ComponentProcessor.getInstance().extractComponentTypeFrom(
(Class<? extends IDIYComponent<?>>) component.getClass());
drawingManager.invalidateComponent(component);
(Class<? extends IDIYComponent<?>>) component.getClass());
if (type.getTransformer() != null && type.getTransformer().canMirror(component)) {
type.getTransformer().mirror(component, center, direction);
}
}
// Remove from area map.
drawingManager.clearComponentAreaMap();
drawingManager.clearContinuityArea();
}
private Point getCenterOf(Collection<IDIYComponent<?>> components, boolean snapToGrid) {
@@ -2780,7 +2780,7 @@
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>BUG_FIX</changeType>
<description>When deleting trace cuts from a vero board, highlight connected areas would still render the area from before the cut was deleted</description>
<description>When moving or deleting trace cuts from a vero board, highlight connected areas would still render the area from before the cut was deleted</description>
</org.diylc.appframework.update.Change>
</changes>
<url>https://github.com/bancika/diy-layout-creator/releases</url>