Skip to content

Commit 6c6646e

Browse files
committed
change setter method usage to direct setting to avoid generating metrics with unset values
1 parent b8b1fc8 commit 6c6646e

File tree

1 file changed

+8
-8
lines changed
  • src/main/java/tech/fastj/graphics/ui/elements

1 file changed

+8
-8
lines changed

src/main/java/tech/fastj/graphics/ui/elements/Button.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ public Button(Scene origin, Pointf location, Pointf initialSize) {
8282
renderPath = DrawUtil.createPath(buttonCoords);
8383
super.setCollisionPath(renderPath);
8484

85-
this.setPaint(DefaultFill);
86-
this.setFont(DefaultFont);
87-
this.setText(DefaultText);
85+
this.paint = DefaultFill;
86+
this.font = DefaultFont;
87+
this.text = DefaultText;
8888

8989
setMetrics(FastJEngine.getDisplay().getGraphics());
9090
}
@@ -105,9 +105,9 @@ public Button(SimpleManager origin, Pointf location, Pointf initialSize) {
105105
renderPath = DrawUtil.createPath(buttonCoords);
106106
super.setCollisionPath(renderPath);
107107

108-
this.setPaint(DefaultFill);
109-
this.setFont(DefaultFont);
110-
this.setText(DefaultText);
108+
this.paint = DefaultFill;
109+
this.font = DefaultFont;
110+
this.text = DefaultText;
111111

112112
setMetrics(FastJEngine.getDisplay().getGraphics());
113113
}
@@ -117,7 +117,7 @@ public Button(SimpleManager origin, Pointf location, Pointf initialSize) {
117117
*
118118
* @return The Button's {@code Paint}.
119119
*/
120-
public Paint getPaint() {
120+
public Paint getFill() {
121121
return paint;
122122
}
123123

@@ -127,7 +127,7 @@ public Paint getPaint() {
127127
* @param paint The new paint for the button.
128128
* @return The {@link Button}, for method chaining.
129129
*/
130-
public Button setPaint(Paint paint) {
130+
public Button setFill(Paint paint) {
131131
this.paint = paint;
132132
return this;
133133
}

0 commit comments

Comments
 (0)