mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
Fixed bug with "Highlight Continuity Areas" that makes random components
conductive
This commit is contained in:
@@ -36,4 +36,6 @@ public interface IDrawingObserver {
|
||||
void stopTrackingContinuityArea();
|
||||
|
||||
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.
|
||||
|
||||
@@ -348,6 +348,9 @@ public abstract class AbstractLeadedComponent<T> extends AbstractTransparentComp
|
||||
g2d.setColor(getLeadColorForPainting(componentState));
|
||||
g2d.setStroke(stroke);
|
||||
g2d.draw(line);
|
||||
|
||||
if (isCopperArea)
|
||||
observer.stopTrackingContinuityArea();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ import java.awt.Color;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Point;
|
||||
|
||||
import org.diylc.common.ObjectCache;
|
||||
import org.diylc.common.SimpleComponentTransformer;
|
||||
import org.diylc.components.AbstractComponent;
|
||||
import org.diylc.components.boards.AbstractBoard;
|
||||
@@ -72,6 +73,7 @@ public class TraceCut extends AbstractComponent<Void> {
|
||||
if (checkPointsClipped(g2d.getClip())) {
|
||||
return;
|
||||
}
|
||||
g2d.setStroke(ObjectCache.getInstance().fetchZoomableStroke(1f));
|
||||
int size = getClosestOdd((int) this.size.convertToPixels());
|
||||
int cutWidth = getClosestOdd((int) CUT_WIDTH.convertToPixels());
|
||||
if (getCutBetweenHoles()) {
|
||||
|
||||
@@ -2534,6 +2534,10 @@
|
||||
<changeType>IMPROVEMENT</changeType>
|
||||
<description>Increase the range of zoom slider for images to 500%</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>BUG_FIX</changeType>
|
||||
<description>Fixed bug with "Highlight Connected Areas" that makes random components conductive</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
</changes>
|
||||
<url>https://github.com/bancika/diy-layout-creator/releases</url>
|
||||
</org.diylc.appframework.update.Version>
|
||||
|
||||
Reference in New Issue
Block a user