mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 09:12:09 +10:00
Better rendering of guitar pickups when dragging and in outline mode
This commit is contained in:
@@ -106,7 +106,7 @@ public class HumbuckerPickup extends AbstractTransparentComponent<String> {
|
|||||||
Shape[] body = getBody();
|
Shape[] body = getBody();
|
||||||
|
|
||||||
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
|
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
|
||||||
if (componentState != ComponentState.DRAGGING) {
|
|
||||||
Composite oldComposite = g2d.getComposite();
|
Composite oldComposite = g2d.getComposite();
|
||||||
if (alpha < MAX_ALPHA) {
|
if (alpha < MAX_ALPHA) {
|
||||||
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f * alpha / MAX_ALPHA));
|
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f * alpha / MAX_ALPHA));
|
||||||
@@ -117,6 +117,7 @@ public class HumbuckerPickup extends AbstractTransparentComponent<String> {
|
|||||||
if (body[1] != null)
|
if (body[1] != null)
|
||||||
g2d.fill(body[1]);
|
g2d.fill(body[1]);
|
||||||
|
|
||||||
|
if (!outlineMode) {
|
||||||
if (body[4] != null) {
|
if (body[4] != null) {
|
||||||
g2d.setColor(getBobinColor1());
|
g2d.setColor(getBobinColor1());
|
||||||
g2d.fill(body[4]);
|
g2d.fill(body[4]);
|
||||||
@@ -125,6 +126,8 @@ public class HumbuckerPickup extends AbstractTransparentComponent<String> {
|
|||||||
g2d.setColor(getBobinColor2());
|
g2d.setColor(getBobinColor2());
|
||||||
g2d.fill(body[5]);
|
g2d.fill(body[5]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (getType() == HumbuckerType.Filtertron) {
|
if (getType() == HumbuckerType.Filtertron) {
|
||||||
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : color);
|
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : color);
|
||||||
g2d.fill(body[0]);
|
g2d.fill(body[0]);
|
||||||
@@ -134,7 +137,7 @@ public class HumbuckerPickup extends AbstractTransparentComponent<String> {
|
|||||||
g2d.fill(body[2]);
|
g2d.fill(body[2]);
|
||||||
|
|
||||||
g2d.setComposite(oldComposite);
|
g2d.setComposite(oldComposite);
|
||||||
}
|
|
||||||
|
|
||||||
Color finalBorderColor;
|
Color finalBorderColor;
|
||||||
if (outlineMode) {
|
if (outlineMode) {
|
||||||
@@ -154,7 +157,8 @@ public class HumbuckerPickup extends AbstractTransparentComponent<String> {
|
|||||||
g2d.draw(body[0]);
|
g2d.draw(body[0]);
|
||||||
if (body[1] != null)
|
if (body[1] != null)
|
||||||
g2d.draw(body[1]);
|
g2d.draw(body[1]);
|
||||||
if (!outlineMode && componentState != ComponentState.DRAGGING) {
|
|
||||||
|
if (!outlineMode) {
|
||||||
g2d.setColor(getPoleColor());
|
g2d.setColor(getPoleColor());
|
||||||
g2d.fill(body[3]);
|
g2d.fill(body[3]);
|
||||||
g2d.setColor(darkerOrLighter(getPoleColor()));
|
g2d.setColor(darkerOrLighter(getPoleColor()));
|
||||||
@@ -173,6 +177,7 @@ public class HumbuckerPickup extends AbstractTransparentComponent<String> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getType() == HumbuckerType.Filtertron) {
|
if (getType() == HumbuckerType.Filtertron) {
|
||||||
g2d.setColor(finalBorderColor);
|
g2d.setColor(finalBorderColor);
|
||||||
g2d.draw(body[0]);
|
g2d.draw(body[0]);
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ public class JazzBassPickup extends AbstractTransparentComponent<String> {
|
|||||||
Shape[] body = getBody();
|
Shape[] body = getBody();
|
||||||
|
|
||||||
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
|
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
|
||||||
if (componentState != ComponentState.DRAGGING) {
|
|
||||||
Composite oldComposite = g2d.getComposite();
|
Composite oldComposite = g2d.getComposite();
|
||||||
if (alpha < MAX_ALPHA) {
|
if (alpha < MAX_ALPHA) {
|
||||||
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f * alpha / MAX_ALPHA));
|
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f * alpha / MAX_ALPHA));
|
||||||
@@ -102,7 +102,6 @@ public class JazzBassPickup extends AbstractTransparentComponent<String> {
|
|||||||
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : POINT_COLOR);
|
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : POINT_COLOR);
|
||||||
g2d.fill(body[2]);
|
g2d.fill(body[2]);
|
||||||
g2d.setComposite(oldComposite);
|
g2d.setComposite(oldComposite);
|
||||||
}
|
|
||||||
|
|
||||||
Color finalBorderColor;
|
Color finalBorderColor;
|
||||||
if (outlineMode) {
|
if (outlineMode) {
|
||||||
@@ -120,7 +119,8 @@ public class JazzBassPickup extends AbstractTransparentComponent<String> {
|
|||||||
g2d.setColor(finalBorderColor);
|
g2d.setColor(finalBorderColor);
|
||||||
g2d.draw(body[0]);
|
g2d.draw(body[0]);
|
||||||
g2d.draw(body[1]);
|
g2d.draw(body[1]);
|
||||||
if (!outlineMode && componentState != ComponentState.DRAGGING) {
|
|
||||||
|
if (!outlineMode) {
|
||||||
g2d.setColor(getPoleColor());
|
g2d.setColor(getPoleColor());
|
||||||
g2d.fill(body[3]);
|
g2d.fill(body[3]);
|
||||||
g2d.setColor(darkerOrLighter(getPoleColor()));
|
g2d.setColor(darkerOrLighter(getPoleColor()));
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ public class P90Pickup extends AbstractTransparentComponent<String> {
|
|||||||
Shape[] body = getBody();
|
Shape[] body = getBody();
|
||||||
|
|
||||||
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
|
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
|
||||||
if (componentState != ComponentState.DRAGGING) {
|
|
||||||
Composite oldComposite = g2d.getComposite();
|
Composite oldComposite = g2d.getComposite();
|
||||||
if (alpha < MAX_ALPHA) {
|
if (alpha < MAX_ALPHA) {
|
||||||
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f * alpha / MAX_ALPHA));
|
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f * alpha / MAX_ALPHA));
|
||||||
@@ -110,7 +110,6 @@ public class P90Pickup extends AbstractTransparentComponent<String> {
|
|||||||
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : POINT_COLOR);
|
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : POINT_COLOR);
|
||||||
g2d.fill(body[2]);
|
g2d.fill(body[2]);
|
||||||
g2d.setComposite(oldComposite);
|
g2d.setComposite(oldComposite);
|
||||||
}
|
|
||||||
|
|
||||||
Color finalBorderColor;
|
Color finalBorderColor;
|
||||||
if (outlineMode) {
|
if (outlineMode) {
|
||||||
@@ -129,7 +128,8 @@ public class P90Pickup extends AbstractTransparentComponent<String> {
|
|||||||
g2d.draw(body[0]);
|
g2d.draw(body[0]);
|
||||||
if (body[1] != null)
|
if (body[1] != null)
|
||||||
g2d.draw(body[1]);
|
g2d.draw(body[1]);
|
||||||
if (!outlineMode && componentState != ComponentState.DRAGGING) {
|
|
||||||
|
if (!outlineMode) {
|
||||||
g2d.setColor(getPoleColor());
|
g2d.setColor(getPoleColor());
|
||||||
g2d.fill(body[3]);
|
g2d.fill(body[3]);
|
||||||
g2d.setColor(darkerOrLighter(getPoleColor()));
|
g2d.setColor(darkerOrLighter(getPoleColor()));
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ public class PBassPickup extends AbstractTransparentComponent<String> {
|
|||||||
Shape[] body = getBody();
|
Shape[] body = getBody();
|
||||||
|
|
||||||
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
|
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
|
||||||
if (componentState != ComponentState.DRAGGING) {
|
|
||||||
Composite oldComposite = g2d.getComposite();
|
Composite oldComposite = g2d.getComposite();
|
||||||
if (alpha < MAX_ALPHA) {
|
if (alpha < MAX_ALPHA) {
|
||||||
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f * alpha / MAX_ALPHA));
|
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f * alpha / MAX_ALPHA));
|
||||||
@@ -100,7 +100,6 @@ public class PBassPickup extends AbstractTransparentComponent<String> {
|
|||||||
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : POINT_COLOR);
|
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : POINT_COLOR);
|
||||||
g2d.fill(body[2]);
|
g2d.fill(body[2]);
|
||||||
g2d.setComposite(oldComposite);
|
g2d.setComposite(oldComposite);
|
||||||
}
|
|
||||||
|
|
||||||
Color finalBorderColor;
|
Color finalBorderColor;
|
||||||
if (outlineMode) {
|
if (outlineMode) {
|
||||||
@@ -118,7 +117,8 @@ public class PBassPickup extends AbstractTransparentComponent<String> {
|
|||||||
g2d.setColor(finalBorderColor);
|
g2d.setColor(finalBorderColor);
|
||||||
g2d.draw(body[0]);
|
g2d.draw(body[0]);
|
||||||
g2d.draw(body[1]);
|
g2d.draw(body[1]);
|
||||||
if (!outlineMode && componentState != ComponentState.DRAGGING) {
|
|
||||||
|
if (!outlineMode) {
|
||||||
g2d.setColor(getPoleColor());
|
g2d.setColor(getPoleColor());
|
||||||
g2d.fill(body[3]);
|
g2d.fill(body[3]);
|
||||||
g2d.setColor(darkerOrLighter(getPoleColor()));
|
g2d.setColor(darkerOrLighter(getPoleColor()));
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ public class SingleCoilPickup extends AbstractTransparentComponent<String> {
|
|||||||
Shape[] body = getBody();
|
Shape[] body = getBody();
|
||||||
|
|
||||||
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
|
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
|
||||||
if (componentState != ComponentState.DRAGGING) {
|
|
||||||
Composite oldComposite = g2d.getComposite();
|
Composite oldComposite = g2d.getComposite();
|
||||||
if (alpha < MAX_ALPHA) {
|
if (alpha < MAX_ALPHA) {
|
||||||
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f * alpha / MAX_ALPHA));
|
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f * alpha / MAX_ALPHA));
|
||||||
@@ -126,7 +126,6 @@ public class SingleCoilPickup extends AbstractTransparentComponent<String> {
|
|||||||
// g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : color);
|
// g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : color);
|
||||||
// g2d.fill(body[3]);
|
// g2d.fill(body[3]);
|
||||||
g2d.setComposite(oldComposite);
|
g2d.setComposite(oldComposite);
|
||||||
}
|
|
||||||
|
|
||||||
Color finalBorderColor;
|
Color finalBorderColor;
|
||||||
if (outlineMode) {
|
if (outlineMode) {
|
||||||
@@ -161,7 +160,7 @@ public class SingleCoilPickup extends AbstractTransparentComponent<String> {
|
|||||||
g2d.draw(body[0]);
|
g2d.draw(body[0]);
|
||||||
g2d.draw(body[3]);
|
g2d.draw(body[3]);
|
||||||
|
|
||||||
if (componentState != ComponentState.DRAGGING && !outlineMode) {
|
if (!outlineMode) {
|
||||||
g2d.setColor(getPoleColor());
|
g2d.setColor(getPoleColor());
|
||||||
g2d.fill(body[2]);
|
g2d.fill(body[2]);
|
||||||
g2d.setColor(darkerOrLighter(getPoleColor()));
|
g2d.setColor(darkerOrLighter(getPoleColor()));
|
||||||
|
|||||||
Binary file not shown.
@@ -2414,6 +2414,10 @@
|
|||||||
<changeType>IMPROVEMENT</changeType>
|
<changeType>IMPROVEMENT</changeType>
|
||||||
<description>Better rendering of IC and transistor pins when zoomed in</description>
|
<description>Better rendering of IC and transistor pins when zoomed in</description>
|
||||||
</org.diylc.appframework.update.Change>
|
</org.diylc.appframework.update.Change>
|
||||||
|
<org.diylc.appframework.update.Change>
|
||||||
|
<changeType>IMPROVEMENT</changeType>
|
||||||
|
<description>Better rendering of guitar pickups when dragging and in outline mode</description>
|
||||||
|
</org.diylc.appframework.update.Change>
|
||||||
<org.diylc.appframework.update.Change>
|
<org.diylc.appframework.update.Change>
|
||||||
<changeType>BUG_FIX</changeType>
|
<changeType>BUG_FIX</changeType>
|
||||||
<description>Drag&Drop from the tree sometimes picks up a wrong component type</description>
|
<description>Drag&Drop from the tree sometimes picks up a wrong component type</description>
|
||||||
|
|||||||
Reference in New Issue
Block a user