mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 09:42:08 +10:00
Better label position on resistors
This commit is contained in:
Binary file not shown.
@@ -179,7 +179,7 @@ public class Resistor extends AbstractLeadedComponent<Resistance> {
|
||||
|
||||
@Override
|
||||
protected int getLabelOffset(int bodyWidth, int labelWidth) {
|
||||
if (value == null)
|
||||
if (value == null || getColorCode() == ResistorColorCode.NONE)
|
||||
return 0;
|
||||
int width = getClosestOdd(getWidth().convertToPixels());
|
||||
Color[] bands = value.getColorCode(colorCode);
|
||||
@@ -187,7 +187,7 @@ public class Resistor extends AbstractLeadedComponent<Resistance> {
|
||||
getShape() == ResistorShape.Standard ? width + FIRST_BAND + BAND_SPACING * (bands.length - 1) : -FIRST_BAND
|
||||
+ BAND_SPACING * (bands.length - 1);
|
||||
|
||||
return (bodyWidth - bandArea - labelWidth) / 2;
|
||||
return bandArea / 2;
|
||||
}
|
||||
|
||||
@EditableProperty(name = "Reverse (standing)")
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1826,6 +1826,10 @@
|
||||
<changeType>IMPROVEMENT</changeType>
|
||||
<description>Increased padding between schematic symbols and their labels</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>IMPROVEMENT</changeType>
|
||||
<description>Better label position on resistors</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>BUG_FIX</changeType>
|
||||
<description>Auto-save dialog pops up when running multiple instances of the app at the same time</description>
|
||||
|
||||
Reference in New Issue
Block a user