Skip to content

Commit

Permalink
Tooltip fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
miozune committed Sep 14, 2024
1 parent cf27516 commit 481dde2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ public RichTooltip(Consumer<Area> parent) {

public void buildTooltip() {
this.dirty = false;
this.text.clearText();
if (this.tooltipBuilder != null) {
this.text.clearText();
this.tooltipBuilder.accept(this);
}
}
Expand Down Expand Up @@ -299,6 +299,7 @@ public RichTooltip tooltipBuilder(Consumer<RichTooltip> tooltipBuilder) {
} else {
this.tooltipBuilder = tooltipBuilder;
}
markDirty();
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ public void markDirty() {
public void draw(ModularGuiContext context, WidgetTheme widgetTheme) {
super.draw(context, widgetTheme);
if (this.autoUpdate || this.dirty) {
this.text.clearText();
if (this.builder != null) {
this.text.clearText();
this.builder.accept(this.text);
}
this.dirty = false;
}
this.text.drawAtZero(context, getArea(), widgetTheme);
}
Expand Down

0 comments on commit 481dde2

Please sign in to comment.