diff --git a/diylc/diylc-library/src/org/diylc/components/passive/Resistor.java b/diylc/diylc-library/src/org/diylc/components/passive/Resistor.java index 44b861a4..3548be96 100644 --- a/diylc/diylc-library/src/org/diylc/components/passive/Resistor.java +++ b/diylc/diylc-library/src/org/diylc/components/passive/Resistor.java @@ -136,7 +136,7 @@ public class Resistor extends AbstractLeadedComponent { @Override protected Shape getBodyShape() { - if (shape == ResistorShape.Standard) { + if (getShape() == ResistorShape.Standard) { double length = getLength().convertToPixels(); double width = getClosestOdd(getWidth().convertToPixels()); Rectangle2D rect = new Rectangle2D.Double(width / 2, width / 10, length - width, width * 8 / 10); @@ -155,7 +155,7 @@ public class Resistor extends AbstractLeadedComponent { return; } int width = getClosestOdd(getWidth().convertToPixels()); - if (shape == ResistorShape.Standard) { + if (getShape() == ResistorShape.Standard) { int x = width + FIRST_BAND; Color[] bands = value.getColorCode(colorCode); g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(2)); @@ -184,7 +184,7 @@ public class Resistor extends AbstractLeadedComponent { int width = getClosestOdd(getWidth().convertToPixels()); Color[] bands = value.getColorCode(colorCode); int bandArea = - shape == ResistorShape.Standard ? width + FIRST_BAND + BAND_SPACING * (bands.length - 1) : -FIRST_BAND + getShape() == ResistorShape.Standard ? width + FIRST_BAND + BAND_SPACING * (bands.length - 1) : -FIRST_BAND + BAND_SPACING * (bands.length - 1); return (bodyWidth - bandArea - labelWidth) / 2; diff --git a/diylc/diylc-swing/library/main.jar b/diylc/diylc-swing/library/main.jar index 6c069187..fd0ea124 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 99699834..e2cc2746 100644 --- a/diylc/diylc-swing/update.xml +++ b/diylc/diylc-swing/update.xml @@ -1716,7 +1716,7 @@ IMPROVEMENT - Solder Pad and Copper Trace size shouldn't be rounded up or down to the nearest integer to allow better precision + Improve precision for Solder Pad and Copper Trace by not rounding the size up or down IMPROVEMENT @@ -1730,6 +1730,10 @@ BUG_FIX Issues with DIL and SIL IC pin alignment when using metric grid and pin spacing + + BUG_FIX + Resistor changes shape on its own + https://github.com/bancika/diy-layout-creator/releases