v0.3.1d: removed strict pixel align pt.2

there is no need to enforce whole interger positions for UI elements. Especially with the recent font changes this was causing alignment problems on high resolution displays.
Elements with non-whole number sizes and positions should be used sparingly, but there's no reason to strictly align them.
This commit is contained in:
Evan Debenham
2015-09-10 20:06:14 -04:00
parent 0ba004b1fa
commit 6313619de7
20 changed files with 80 additions and 85 deletions
@@ -106,10 +106,10 @@ public class BadgesList extends ScrollPane {
@Override
protected void layout() {
icon.x = x;
icon.y = PixelScene.align( y + (height - icon.height) / 2 );
icon.y = y + (height - icon.height) / 2;
label.x = icon.x + icon.width + 2;
label.y = PixelScene.align( y + (height - label.baseLine()) / 2 );
label.y = y + (height - label.baseLine()) / 2;
}
public boolean onClick( float x, float y ) {
@@ -69,7 +69,7 @@ public class DangerIndicator extends Tag {
private void placeNumber() {
number.x = right() - 11 - number.width();
number.y = PixelScene.align( y + (height - number.baseLine()) / 2 );
number.y = y + (height - number.baseLine()) / 2;
}
@Override
@@ -124,8 +124,8 @@ public class QuickSlotButton extends Button implements WndBag.Listener {
slot.fill( this );
crossB.x = PixelScene.align( x + (width - crossB.width) / 2 );
crossB.y = PixelScene.align( y + (height - crossB.height) / 2 );
crossB.x = x + (width - crossB.width) / 2;
crossB.y = y + (height - crossB.height) / 2;
}
@Override
@@ -177,8 +177,8 @@ public class QuickSlotButton extends Button implements WndBag.Listener {
if (Actor.chars().contains( lastTarget )) {
lastTarget.sprite.parent.add( crossM );
crossM.point( DungeonTilemap.tileToWorld( lastTarget.pos ) );
crossB.x = PixelScene.align( x + (width - crossB.width) / 2 );
crossB.y = PixelScene.align( y + (height - crossB.height) / 2 );
crossB.x = x + (width - crossB.width) / 2;
crossB.y = y + (height - crossB.height) / 2;
crossB.visible = true;
} else {
lastTarget = null;
@@ -185,8 +185,8 @@ public class StatusPane extends Component {
lastLvl = Dungeon.hero.lvl;
level.text( Integer.toString( lastLvl ) );
level.measure();
level.x = PixelScene.align( 27.0f - level.width() / 2 );
level.y = PixelScene.align( 27.5f - level.baseLine() / 2 );
level.x = 27.0f - level.width() / 2;
level.y = 27.5f - level.baseLine() / 2;
}
int k = IronKey.curDepthQuantity;