v0.2.3: tweaks to IconTitle

This commit is contained in:
Evan Debenham 2015-01-03 17:50:24 -05:00
parent 3c615788cc
commit 0db40dbf87

View File

@ -65,18 +65,18 @@ public class IconTitle extends Component {
@Override @Override
protected void layout() { protected void layout() {
imIcon.x = 0; imIcon.x = this.x;
imIcon.y = 0; imIcon.y = this.y;
tfLabel.x = PixelScene.align( PixelScene.uiCamera, imIcon.x + imIcon.width() + GAP ); tfLabel.x = PixelScene.align( PixelScene.uiCamera, imIcon.x + imIcon.width() + GAP );
tfLabel.maxWidth = (int)(width - tfLabel.x); tfLabel.maxWidth = (int)(width - tfLabel.x);
tfLabel.measure(); tfLabel.measure();
tfLabel.y = PixelScene.align( PixelScene.uiCamera, tfLabel.y = PixelScene.align( PixelScene.uiCamera,
imIcon.height > tfLabel.height() ? imIcon.height > tfLabel.height() ?
1+ (imIcon.height() - tfLabel.height()) / 2 : imIcon.y + 1 + (imIcon.height() - tfLabel.height()) / 2 :
imIcon.y ); imIcon.y );
height = Math.max( imIcon.y + imIcon.height(), tfLabel.y + tfLabel.height() ); height = Math.max( imIcon.height(), tfLabel.height() );
} }
public void icon( Image icon ) { public void icon( Image icon ) {