mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
Render resistor color bands properly when zommed in
This commit is contained in:
@@ -179,7 +179,7 @@ public class Resistor extends AbstractLeadedComponent<Resistance> {
|
||||
if (getShape() == ResistorShape.Standard) {
|
||||
int x = width + FIRST_BAND;
|
||||
Color[] bands = value.getColorCode(colorCode);
|
||||
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(2));
|
||||
g2d.setStroke(ObjectCache.getInstance().fetchZoomableStroke(2));
|
||||
for (int i = 0; i < bands.length; i++) {
|
||||
g2d.setColor(bands[i]);
|
||||
g2d.drawLine(x, width / 10 + 2, x, width * 8 / 10 + 1);
|
||||
@@ -189,7 +189,7 @@ public class Resistor extends AbstractLeadedComponent<Resistance> {
|
||||
int x = -FIRST_BAND;
|
||||
int height = getClosestOdd(getWidth().convertToPixels());
|
||||
Color[] bands = value.getColorCode(colorCode);
|
||||
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(2));
|
||||
g2d.setStroke(ObjectCache.getInstance().fetchZoomableStroke(2));
|
||||
for (int i = 0; i < bands.length; i++) {
|
||||
g2d.setColor(bands[i]);
|
||||
g2d.drawLine(x, 1, x, height - 1);
|
||||
|
||||
Reference in New Issue
Block a user