Added "Label Orientation" property to leaded components that can be used

to force labels to be rendered horizontally instead of following
component placement direction
This commit is contained in:
Branislav Stojkovic
2019-01-10 18:44:23 +01:00
parent 0f3f2a350b
commit 7caadec1ec
6 changed files with 34 additions and 6 deletions
Binary file not shown.
@@ -200,7 +200,7 @@ public class Resistor extends AbstractLeadedComponent<Resistance> {
@Override
protected int getLabelOffset(int bodyWidth, int labelWidth) {
if (value == null || getColorCode() == ResistorColorCode.NONE)
if (value == null || getColorCode() == ResistorColorCode.NONE || getLabelOriantation() != AbstractLeadedComponent.LabelOriantation.Directional)
return 0;
int width = getClosestOdd(getWidth().convertToPixels());
Color[] bands = value.getColorCode(colorCode);