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