Fixed bug with "Highlight Continuity Areas" that makes random components

conductive
This commit is contained in:
Branislav Stojkovic
2019-03-01 09:51:55 +01:00
parent c9a32cc390
commit b0123db3e7
6 changed files with 21 additions and 2 deletions
@@ -35,5 +35,7 @@ public interface IDrawingObserver {
void stopTrackingContinuityArea();
void startTrackingContinuityArea(boolean positive);
void startTrackingContinuityArea(boolean positive);
boolean isTrackingContinuityArea();
}
@@ -264,6 +264,10 @@ public class DrawingManager {
// Draw the component through the g2dWrapper.
try {
component.draw(g2dWrapper, state, drawOptions.contains(DrawOption.OUTLINE_MODE), project, g2dWrapper);
if (g2dWrapper.isTrackingContinuityArea()) {
LOG.info("Component " + component.getName() + " of type " + component.getClass().getName() + " did not stop tracking continuity area.");
g2dWrapper.stopTrackingContinuityArea();
}
} catch (Exception e) {
LOG.error("Error drawing " + component.getName(), e);
failedComponents.add(component);
@@ -162,6 +162,10 @@ class G2DWrapper extends Graphics2D implements IDrawingObserver {
this.trackingContinuityAllowed = false;
}
@Override
public boolean isTrackingContinuityArea() {
return trackingContinuityAllowed;
}
/**
* Appends shape interior to the current component area.