mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-13 02:32:09 +10:00
'Drill Hole' changes color to red when selected
This commit is contained in:
@@ -401,6 +401,10 @@
|
|||||||
<changeType>IMPROVEMENT</changeType>
|
<changeType>IMPROVEMENT</changeType>
|
||||||
<description>Corrected 'Mini Toggle Switch' position names for center-OFF variants to be in the correct order (thank you mm-rnd)</description>
|
<description>Corrected 'Mini Toggle Switch' position names for center-OFF variants to be in the correct order (thank you mm-rnd)</description>
|
||||||
</org.diylc.appframework.update.Change>
|
</org.diylc.appframework.update.Change>
|
||||||
|
<org.diylc.appframework.update.Change>
|
||||||
|
<changeType>IMPROVEMENT</changeType>
|
||||||
|
<description>'Drill Hole' changes color to red when selected</description>
|
||||||
|
</org.diylc.appframework.update.Change>
|
||||||
</changes>
|
</changes>
|
||||||
<url>https://github.com/bancika/diy-layout-creator/releases</url>
|
<url>https://github.com/bancika/diy-layout-creator/releases</url>
|
||||||
</org.diylc.appframework.update.Version>
|
</org.diylc.appframework.update.Version>
|
||||||
|
|||||||
+5
-9
@@ -66,19 +66,13 @@ public class DrillHole extends AbstractTransparentComponent<Void>
|
|||||||
public void draw(Graphics2D g2d, ComponentState componentState, boolean outlineMode,
|
public void draw(Graphics2D g2d, ComponentState componentState, boolean outlineMode,
|
||||||
Project project, IDrawingObserver drawingObserver,
|
Project project, IDrawingObserver drawingObserver,
|
||||||
IGerberDrawingObserver gerberDrawingObserver) {
|
IGerberDrawingObserver gerberDrawingObserver) {
|
||||||
|
|
||||||
if (checkPointsClipped(g2d.getClip())) {
|
if (checkPointsClipped(g2d.getClip())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
double holeDiameter = getDiameter().convertToPixels();
|
double holeDiameter = getDiameter().convertToPixels();
|
||||||
double borderWidth = STROKE_WIDTH.convertToPixels(); // Use constant stroke width
|
double borderWidth = STROKE_WIDTH.convertToPixels(); // Use constant stroke width
|
||||||
|
|
||||||
g2d.setColor(
|
|
||||||
componentState == ComponentState.SELECTED || componentState == ComponentState.DRAGGING
|
|
||||||
? SELECTION_COLOR
|
|
||||||
: color);
|
|
||||||
|
|
||||||
drawingObserver.startTrackingContinuityArea(true);
|
|
||||||
|
|
||||||
// Export to Gerber drill layer
|
// Export to Gerber drill layer
|
||||||
if (gerberDrawingObserver != null) {
|
if (gerberDrawingObserver != null) {
|
||||||
GerberLayer drillLayer = GerberLayer.DrillNonPlated;
|
GerberLayer drillLayer = GerberLayer.DrillNonPlated;
|
||||||
@@ -96,7 +90,10 @@ public class DrillHole extends AbstractTransparentComponent<Void>
|
|||||||
holeDiameter, holeDiameter));
|
holeDiameter, holeDiameter));
|
||||||
|
|
||||||
// Draw colored border
|
// Draw colored border
|
||||||
g2d.setColor(color);
|
g2d.setColor(
|
||||||
|
componentState == ComponentState.SELECTED || componentState == ComponentState.DRAGGING
|
||||||
|
? SELECTION_COLOR
|
||||||
|
: color);
|
||||||
g2d.setStroke(new BasicStroke((float) borderWidth));
|
g2d.setStroke(new BasicStroke((float) borderWidth));
|
||||||
g2d.draw(new Ellipse2D.Double(point.getX() - holeDiameter / 2, point.getY() - holeDiameter / 2,
|
g2d.draw(new Ellipse2D.Double(point.getX() - holeDiameter / 2, point.getY() - holeDiameter / 2,
|
||||||
holeDiameter, holeDiameter));
|
holeDiameter, holeDiameter));
|
||||||
@@ -118,7 +115,6 @@ public class DrillHole extends AbstractTransparentComponent<Void>
|
|||||||
point.getX(), point.getY() + crosshairLength / 2));
|
point.getX(), point.getY() + crosshairLength / 2));
|
||||||
|
|
||||||
drawingObserver.stopTracking();
|
drawingObserver.stopTracking();
|
||||||
drawingObserver.stopTrackingContinuityArea();
|
|
||||||
|
|
||||||
if (gerberDrawingObserver != null) {
|
if (gerberDrawingObserver != null) {
|
||||||
gerberDrawingObserver.stopGerberOutput();
|
gerberDrawingObserver.stopGerberOutput();
|
||||||
|
|||||||
Reference in New Issue
Block a user