improved lead drawing

This commit is contained in:
bancika
2011-01-20 23:34:33 +00:00
parent be7e9a1d53
commit 9ae74ac0a1
6 changed files with 15 additions and 9 deletions
@@ -72,7 +72,7 @@ public class AxialFilmCapacitor extends AbstractLeadedComponent<Capacitance> {
@Override
protected Shape getBodyShape() {
return new Rectangle2D.Double(0f, 0f, getWidth().convertToPixels(), getHeight()
.convertToPixels());
return new Rectangle2D.Double(0f, 0f, getWidth().convertToPixels(),
getClosestOdd(getHeight().convertToPixels()));
}
}
@@ -72,7 +72,7 @@ public class RadialCeramicDiskCapacitor extends AbstractLeadedComponent<Capacita
@Override
protected Shape getBodyShape() {
return new Ellipse2D.Double(0f, 0f, getWidth().convertToPixels(), getHeight()
.convertToPixels());
return new Ellipse2D.Double(0f, 0f, getWidth().convertToPixels(), getClosestOdd(getHeight()
.convertToPixels()));
}
}
@@ -73,7 +73,7 @@ public class RadialFilmCapacitor extends AbstractLeadedComponent<Capacitance> {
@Override
protected Shape getBodyShape() {
double radius = getHeight().convertToPixels() * 0.7;
return new RoundRectangle2D.Double(0f, 0f, getWidth().convertToPixels(), getHeight()
.convertToPixels(), radius, radius);
return new RoundRectangle2D.Double(0f, 0f, getWidth().convertToPixels(),
getClosestOdd(getHeight().convertToPixels()), radius, radius);
}
}
@@ -72,7 +72,7 @@ public class Resistor extends AbstractLeadedComponent<Resistance> {
@Override
protected Shape getBodyShape() {
return new Rectangle2D.Double(0f, 0f, getWidth().convertToPixels(), getHeight()
.convertToPixels());
return new Rectangle2D.Double(0f, 0f, getWidth().convertToPixels(),
getClosestOdd(getHeight().convertToPixels()));
}
}