diff --git a/diylc/diylc-library/lib/diylc-core.jar b/diylc/diylc-library/lib/diylc-core.jar index acd545c8..a40bd210 100644 Binary files a/diylc/diylc-library/lib/diylc-core.jar and b/diylc/diylc-library/lib/diylc-core.jar differ diff --git a/diylc/diylc-library/src/org/diylc/components/AbstractLeadedComponent.java b/diylc/diylc-library/src/org/diylc/components/AbstractLeadedComponent.java index d2f61b01..16b645f6 100644 --- a/diylc/diylc-library/src/org/diylc/components/AbstractLeadedComponent.java +++ b/diylc/diylc-library/src/org/diylc/components/AbstractLeadedComponent.java @@ -293,8 +293,16 @@ public abstract class AbstractLeadedComponent extends AbstractTransparentComp private void drawLead(Graphics2D g2d, ComponentState componentState, IDrawingObserver observer, boolean isCopperArea) { if (isCopperArea) observer.startTrackingContinuityArea(true); - - float thickness = getLeadThickness() - 1; + + float thickness = getLeadThickness(); + + Line2D line = new Line2D.Double(points[0].x, points[0].y, points[1].x, points[1].y); + + if (shouldShadeLeads()) { + // for some reason the stroked line gets approx 1px thicker when converted to shape + thickness -= 1; + } + Stroke stroke = null; switch (getStyle()) { case SOLID: @@ -308,23 +316,24 @@ public abstract class AbstractLeadedComponent extends AbstractTransparentComp stroke = ObjectCache.getInstance().fetchStroke(thickness, new float[] {thickness / 4, thickness * 4}, 0); break; } - - Line2D line = new Line2D.Double(points[0].x, points[0].y, points[1].x, points[1].y); - Shape lineShape = stroke.createStrokedShape(line); - Color leadColor = - shouldShadeLeads() ? getLeadColorForPainting(componentState) : getLeadColorForPainting(componentState); - g2d.setColor(leadColor); - g2d.fill(lineShape); - - if (isCopperArea) - observer.stopTrackingContinuityArea(); - - if (shouldShadeLeads()) { + if (shouldShadeLeads()) { + Shape lineShape = stroke.createStrokedShape(line); + + g2d.setColor(getLeadColorForPainting(componentState)); + g2d.fill(lineShape); + + if (isCopperArea) + observer.stopTrackingContinuityArea(); + g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1f)); leadColor = getLeadColorForPainting(componentState); g2d.setColor(leadColor.darker()); - g2d.draw(lineShape); + g2d.draw(lineShape); + } else { + g2d.setColor(getLeadColorForPainting(componentState)); + g2d.setStroke(stroke); + g2d.draw(line); } } diff --git a/diylc/diylc-swing/lib/diylc-core.jar b/diylc/diylc-swing/lib/diylc-core.jar index acd545c8..a40bd210 100644 Binary files a/diylc/diylc-swing/lib/diylc-core.jar and b/diylc/diylc-swing/lib/diylc-core.jar differ diff --git a/diylc/diylc-swing/library/main.jar b/diylc/diylc-swing/library/main.jar index 2c266d5a..daa0e842 100644 Binary files a/diylc/diylc-swing/library/main.jar and b/diylc/diylc-swing/library/main.jar differ diff --git a/diylc/diylc-swing/update.xml b/diylc/diylc-swing/update.xml index 8aad1cdf..aac529d4 100644 --- a/diylc/diylc-swing/update.xml +++ b/diylc/diylc-swing/update.xml @@ -2290,6 +2290,10 @@ IMPROVEMENT Chrome-style cursors for mouse scrolling with arrows showing the exact scrolling direction + + BUG_FIX + Since 3.49, straight traces are rendered 1px thinner than curved traces of the same thickness + https://github.com/bancika/diy-layout-creator/releases