mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +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
|
@Override
|
||||||
protected int getLabelOffset(int bodyWidth, int labelWidth) {
|
protected int getLabelOffset(int bodyWidth, int labelWidth) {
|
||||||
if (value == null)
|
if (value == null || getColorCode() == ResistorColorCode.NONE)
|
||||||
return 0;
|
return 0;
|
||||||
int width = getClosestOdd(getWidth().convertToPixels());
|
int width = getClosestOdd(getWidth().convertToPixels());
|
||||||
Color[] bands = value.getColorCode(colorCode);
|
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
|
getShape() == ResistorShape.Standard ? width + FIRST_BAND + BAND_SPACING * (bands.length - 1) : -FIRST_BAND
|
||||||
+ BAND_SPACING * (bands.length - 1);
|
+ BAND_SPACING * (bands.length - 1);
|
||||||
|
|
||||||
return (bodyWidth - bandArea - labelWidth) / 2;
|
return bandArea / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@EditableProperty(name = "Reverse (standing)")
|
@EditableProperty(name = "Reverse (standing)")
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -1826,6 +1826,10 @@
|
|||||||
<changeType>IMPROVEMENT</changeType>
|
<changeType>IMPROVEMENT</changeType>
|
||||||
<description>Increased padding between schematic symbols and their labels</description>
|
<description>Increased padding between schematic symbols and their labels</description>
|
||||||
</org.diylc.appframework.update.Change>
|
</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>
|
<org.diylc.appframework.update.Change>
|
||||||
<changeType>BUG_FIX</changeType>
|
<changeType>BUG_FIX</changeType>
|
||||||
<description>Auto-save dialog pops up when running multiple instances of the app at the same time</description>
|
<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