diff --git a/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/components/AbstractLeadedComponent.java b/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/components/AbstractLeadedComponent.java index 6a2cb862..476a7ae3 100644 --- a/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/components/AbstractLeadedComponent.java +++ b/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/components/AbstractLeadedComponent.java @@ -54,7 +54,6 @@ public abstract class AbstractLeadedComponent extends AbstractTransparentComp @Override public void draw(Graphics2D g2d, ComponentState componentState, Project project) { - g2d.setStroke(new BasicStroke(getLeadThickness().convertToPixels())); double distance = points[0].distance(points[1]); Shape shape = getBodyShape(); if (shape == null) { @@ -80,15 +79,17 @@ public abstract class AbstractLeadedComponent extends AbstractTransparentComp g2d.fill(shape); g2d.setComposite(oldComposite); } + g2d.setStroke(new BasicStroke(1)); + g2d.setColor(componentState == ComponentState.SELECTED + || componentState == ComponentState.DRAGGING ? SELECTION_COLOR : borderColor); + g2d.draw(shape); // Draw leads. + g2d.setStroke(new BasicStroke(getLeadThickness().convertToPixels())); g2d.setColor(getLeadColor()); g2d.drawLine((int) (shapeRect.width - distance) / 2, (int) shapeRect.height / 2, (int) ((shapeRect.width - distance) / 2 + leadLenght), (int) shapeRect.height / 2); g2d.drawLine((int) (shapeRect.width + distance) / 2, (int) shapeRect.height / 2, (int) ((shapeRect.width + distance) / 2 - leadLenght), (int) shapeRect.height / 2); - g2d.setStroke(new BasicStroke(1)); - g2d.setColor(borderColor); - g2d.draw(shape); // Draw label. g2d.setFont(Constants.LABEL_FONT); g2d