1
mirror of https://github.com/Shiewk/Widgets.git synced 2026-04-28 11:34:17 +02:00

Allow resizing BasicTextWidgets

This commit is contained in:
Shy
2024-10-20 12:21:21 +02:00
parent 59acc266f2
commit 0027b67eac
6 changed files with 41 additions and 14 deletions
@@ -31,7 +31,7 @@ public class WidgetSettingsScreen extends AnimatedScreen {
@Override
public void renderScreenContents(DrawContext context, int mouseX, int mouseY, float delta) {
context.drawText(textRenderer, previewText, this.width * 3 / 4 - textRenderer.getWidth(previewText) / 2, this.height / 50, 0xffffffff, false);
widget.render(context, Util.getMeasuringTimeNano(), textRenderer, this.width * 3 / 4 - widget.width() / 2, this.height / 2 - widget.height() / 2);
widget.render(context, Util.getMeasuringTimeNano(), textRenderer, (int) ((float) (this.width * 3) / 4 - (widget.width() * widget.getScaleFactor()) / 2), (int) ((float) this.height / 2 - (widget.height() * widget.getScaleFactor()) / 2));
}
@Override