mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-13 02:32:09 +10:00
fix for transparency when dragging
This commit is contained in:
@@ -149,7 +149,7 @@ public abstract class AbstractCurvedComponent<T> extends AbstractTransparentComp
|
||||
path.curveTo(p[4].getX(), p[4].getY(), p[5].getX(), p[5].getY(), p[6].getX(), p[6].getY());
|
||||
}
|
||||
|
||||
Composite oldComposite = applyAlpha(g2d, componentState);
|
||||
Composite oldComposite = applyAlpha(g2d);
|
||||
|
||||
drawCurve(path, g2d, componentState, drawingObserver);
|
||||
|
||||
|
||||
@@ -64,4 +64,13 @@ public abstract class AbstractTransparentComponent<T> extends AbstractComponent<
|
||||
}
|
||||
return oldComposite;
|
||||
}
|
||||
|
||||
public Composite applyAlpha(Graphics2D g2d) {
|
||||
Composite oldComposite = g2d.getComposite();
|
||||
int alpha = getAlpha().getValue();
|
||||
if (alpha < MAX_ALPHA) {
|
||||
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha / 100f));
|
||||
}
|
||||
return oldComposite;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -317,6 +317,10 @@
|
||||
<changeType>NEW_FEATURE</changeType>
|
||||
<description>Added more ceramic resistor variants to 'Resistor' component</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>IMPROVEMENT</changeType>
|
||||
<description>Improved rendering of components while being dragged to show only the outline, making it easier to place</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>IMPROVEMENT</changeType>
|
||||
<description>Improved data model for storing transparency alpha and other properties that are edited using a slider widget; as a result, the editing is more precise and does not randomly change to neighboring values</description>
|
||||
|
||||
Reference in New Issue
Block a user