better pin rendering

This commit is contained in:
Branislav Stojkovic
2019-02-03 19:45:29 +01:00
parent 81b299865c
commit a0b78a5e3d
8 changed files with 18 additions and 8 deletions
@@ -353,7 +353,8 @@ public class BridgeRectifier extends AbstractTransparentComponent<String> {
PinShape pinShape = rectifierType.getPinShape();
int pinSize = (int) (pinShape == PinShape.Round ? ROUND_PIN_SIZE.convertToPixels() : SQUARE_PIN_SIZE.convertToPixels()) / 2 * 2;
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1f));
if (!outlineMode) {
for (Point point : controlPoints) {
g2d.setColor(PIN_COLOR);
@@ -309,13 +309,14 @@ public class DIL_IC extends AbstractTransparentComponent<String> {
if (checkPointsClipped(g2d.getClip())) {
return;
}
Area mainArea = getBody()[0];
Area mainArea = getBody()[0];
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1f));
if (!outlineMode) {
int pinSize = (int) PIN_SIZE.convertToPixels() / 2 * 2;
for (Point point : controlPoints) {
g2d.setColor(PIN_COLOR);
g2d.fillRect(point.x - pinSize / 2, point.y - pinSize / 2, pinSize, pinSize);
g2d.setColor(PIN_BORDER_COLOR);
g2d.setColor(PIN_BORDER_COLOR);
g2d.drawRect(point.x - pinSize / 2, point.y - pinSize / 2, pinSize, pinSize);
}
}
@@ -284,12 +284,13 @@ public class SIL_IC extends AbstractTransparentComponent<String> {
}
Area mainArea = getBody()[0];
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1f));
if (!outlineMode) {
int pinSize = (int) PIN_SIZE.convertToPixels() / 2 * 2;
for (Point point : controlPoints) {
g2d.setColor(PIN_COLOR);
g2d.fillOval(point.x - pinSize / 2, point.y - pinSize / 2, pinSize, pinSize);
g2d.setColor(PIN_BORDER_COLOR);
g2d.setColor(PIN_BORDER_COLOR);
g2d.drawOval(point.x - pinSize / 2, point.y - pinSize / 2, pinSize, pinSize);
}
}
@@ -218,12 +218,13 @@ public class TransistorTO1 extends AbstractTransparentComponent<String> {
int pinSize = (int) PIN_SIZE.convertToPixels() / 2 * 2;
Theme theme = (Theme) ConfigurationManager.getInstance().readObject(IPlugInPort.THEME_KEY, Constants.DEFAULT_THEME);
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1f));
for (Point point : controlPoints) {
if (!outlineMode) {
g2d.setColor(PIN_COLOR);
g2d.fillOval(point.x - pinSize / 2, point.y - pinSize / 2, pinSize, pinSize);
}
g2d.setColor(outlineMode ? theme.getOutlineColor() : PIN_BORDER_COLOR);
g2d.setColor(outlineMode ? theme.getOutlineColor() : PIN_BORDER_COLOR);
g2d.drawOval(point.x - pinSize / 2, point.y - pinSize / 2, pinSize, pinSize);
}
@@ -252,13 +252,14 @@ public class TransistorTO3 extends AbstractTransparentComponent<String> {
}
int pinSize = (int) PIN_DIAMETER.convertToPixels() / 2 * 2;
Theme theme = (Theme) ConfigurationManager.getInstance().readObject(IPlugInPort.THEME_KEY, Constants.DEFAULT_THEME);
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1f));
for (Point point : controlPoints) {
if (!outlineMode) {
g2d.setColor(PIN_COLOR);
g2d.fillOval(point.x - pinSize / 2, point.y - pinSize / 2, pinSize, pinSize);
}
g2d.setColor(outlineMode ? theme.getOutlineColor() : PIN_BORDER_COLOR);
g2d.setColor(outlineMode ? theme.getOutlineColor() : PIN_BORDER_COLOR);
g2d.drawOval(point.x - pinSize / 2, point.y - pinSize / 2, pinSize, pinSize);
}
@@ -250,12 +250,13 @@ public class TransistorTO92 extends AbstractTransparentComponent<String> {
return;
}
int pinSize = (int) PIN_SIZE.convertToPixels() / 2 * 2;
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1f));
if (!outlineMode) {
for (Point point : controlPoints) {
g2d.setColor(PIN_COLOR);
g2d.fillOval(point.x - pinSize / 2, point.y - pinSize / 2, pinSize, pinSize);
g2d.setColor(PIN_BORDER_COLOR);
g2d.setColor(PIN_BORDER_COLOR);
g2d.drawOval(point.x - pinSize / 2, point.y - pinSize / 2, pinSize, pinSize);
}
}
Binary file not shown.
+5 -1
View File
@@ -2401,7 +2401,11 @@
<org.diylc.appframework.update.Change>
<changeType>IMPROVEMENT</changeType>
<description>Automatically select dropped components from the component tree after they get placed</description>
</org.diylc.appframework.update.Change>
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>IMPROVEMENT</changeType>
<description>Better rendering of IC and transistor pins when zoomed in</description>
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>BUG_FIX</changeType>
<description>Drag&amp;Drop from the tree sometimes picks up a wrong component type</description>