Better rendering of guitar pickups when dragging and in outline mode

This commit is contained in:
Branislav Stojkovic
2019-02-05 17:23:44 +01:00
parent 9c81ad0eec
commit c120bc10ed
7 changed files with 94 additions and 86 deletions
@@ -106,7 +106,7 @@ 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));
@@ -117,6 +117,7 @@ public class HumbuckerPickup extends AbstractTransparentComponent<String> {
if (body[1] != null)
g2d.fill(body[1]);
if (!outlineMode) {
if (body[4] != null) {
g2d.setColor(getBobinColor1());
g2d.fill(body[4]);
@@ -125,6 +126,8 @@ 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]);
@@ -134,7 +137,7 @@ public class HumbuckerPickup extends AbstractTransparentComponent<String> {
g2d.fill(body[2]);
g2d.setComposite(oldComposite);
}
Color finalBorderColor;
if (outlineMode) {
@@ -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,7 +91,7 @@ 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));
@@ -102,7 +102,6 @@ public class JazzBassPickup extends AbstractTransparentComponent<String> {
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,7 +98,7 @@ 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));
@@ -110,7 +110,6 @@ public class P90Pickup extends AbstractTransparentComponent<String> {
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,7 +89,7 @@ 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));
@@ -100,7 +100,6 @@ public class PBassPickup extends AbstractTransparentComponent<String> {
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,7 +107,7 @@ 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));
@@ -126,7 +126,6 @@ public class SingleCoilPickup extends AbstractTransparentComponent<String> {
// g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : color);
// g2d.fill(body[3]);
g2d.setComposite(oldComposite);
}
Color finalBorderColor;
if (outlineMode) {
@@ -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.
+4
View File
@@ -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&amp;Drop from the tree sometimes picks up a wrong component type</description>