v0.9.2: fixed rare layout issues in styled buttons due to text tweaks
This commit is contained in:
parent
5f6285d3d2
commit
a20df5c724
|
@ -282,8 +282,6 @@ public class NewsScene extends PixelScene {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void layout() {
|
protected void layout() {
|
||||||
text.maxWidth( (int)(width - icon.width() - bg.marginHor() - 2));
|
|
||||||
|
|
||||||
super.layout();
|
super.layout();
|
||||||
|
|
||||||
icon.x = x + bg.marginLeft() + (16-icon.width())/2f;
|
icon.x = x + bg.marginLeft() + (16-icon.width())/2f;
|
||||||
|
|
|
@ -65,7 +65,7 @@ public class StyledButton extends Button {
|
||||||
if (icon != null) componentWidth += icon.width() + 2;
|
if (icon != null) componentWidth += icon.width() + 2;
|
||||||
|
|
||||||
if (text != null && !text.text().equals("")){
|
if (text != null && !text.text().equals("")){
|
||||||
text.maxWidth( (int)(width - componentWidth - 2) );
|
text.maxWidth( (int)(width - componentWidth - bg.marginHor() - 2));
|
||||||
componentWidth += text.width() + 2;
|
componentWidth += text.width() + 2;
|
||||||
|
|
||||||
text.setPos(
|
text.setPos(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user