mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-02-21 20:18:14 +07:00
Centered NPC dialog text as good as I can without rewriting TextArea
This commit is contained in:
parent
e5418464fa
commit
5540c6436c
@ -54,6 +54,7 @@ public class NpcDialogBox extends Table implements Disposable {
|
||||
scrollPane.setFlingTime(0);
|
||||
scrollPane.setOverscroll(false, false);
|
||||
scrollPane.setClamp(false);
|
||||
scrollPane.setScrollX(-15); // FIXME: actual preferred width of text isn't calculated anywhere, this is best guess
|
||||
add(scrollPane).size(330, 128);
|
||||
pack();
|
||||
|
||||
|
@ -445,7 +445,7 @@ public class ScrollPane extends WidgetGroup {
|
||||
maxX -= scrollbarWidth;
|
||||
}
|
||||
}
|
||||
scrollX(MathUtils.clamp(amountX, 0, maxX));
|
||||
scrollX(amountX);
|
||||
scrollY(amountY);
|
||||
|
||||
// Set the bounds and scroll knob sizes if scrollbars are needed.
|
||||
@ -522,7 +522,7 @@ public class ScrollPane extends WidgetGroup {
|
||||
y -= (int)(maxY - visualAmountY);
|
||||
|
||||
float x = widgetAreaBounds.x;
|
||||
if (scrollX) x -= (int)visualAmountX;
|
||||
/*if (scrollX) */x -= (int)visualAmountX;
|
||||
|
||||
if (!fadeScrollBars && scrollbarsOnTop) {
|
||||
if (scrollX && hScrollOnBottom) {
|
||||
@ -767,7 +767,8 @@ public class ScrollPane extends WidgetGroup {
|
||||
}
|
||||
|
||||
public void setScrollX (float pixels) {
|
||||
scrollX(MathUtils.clamp(pixels, 0, maxX));
|
||||
//scrollX(MathUtils.clamp(pixels, 0, maxX));
|
||||
scrollX(pixels);
|
||||
}
|
||||
|
||||
/** Returns the x scroll position in pixels, where 0 is the left of the scroll pane. */
|
||||
|
Loading…
Reference in New Issue
Block a user