Skip to content

Commit

Permalink
Jmr3366 - FR RPTools#1386 to allow opacity to be set at 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Jmr3366 committed Apr 13, 2023
1 parent a035827 commit 79ee651
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@
</constraints>
<properties>
<majorTickSpacing value="10"/>
<minimum value="5"/>
<minimum value="0"/>
<minorTickSpacing value="5"/>
<name value="tokenOpacitySlider"/>
<orientation value="1"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ public class TokenPropertiesDialog {
panel11.add(spacer8, new GridConstraints(0, 9, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));
final JSlider slider1 = new JSlider();
slider1.setMajorTickSpacing(10);
slider1.setMinimum(5);
slider1.setMinimum(0);
slider1.setMinorTickSpacing(5);
slider1.setName("tokenOpacitySlider");
slider1.setOrientation(1);
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/net/rptools/maptool/model/Token.java
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ public Color getHaloColor() {
}

public float getTokenOpacity() {
if (tokenOpacity <= 0.0f) {
if (tokenOpacity < 0.0f) {
tokenOpacity = 1.0f;
}

Expand All @@ -701,8 +701,8 @@ public float setTokenOpacity(float alpha) {
if (alpha > 1.0f) {
alpha = 1.0f;
}
if (alpha <= 0.0f) {
alpha = 0.05f;
if (alpha < 0.0f) {
alpha = 0.0f;
}

tokenOpacity = alpha;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4981,7 +4981,7 @@
<at name="width">29</at>
<at name="majorTickSpacing">20</at>
<at name="minorTickSpacing">5</at>
<at name="minimum">5</at>
<at name="minimum">0</at>
<at name="value">100</at>
<at name="height">109</at>
</object>
Expand Down

0 comments on commit 79ee651

Please sign in to comment.