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
@@ -53,8 +53,8 @@ public class WndBadge extends Window {
float pos = icon.y + icon.height() + MARGIN;
for (BitmapText line : info.new LineSplitter().split()) {
line.measure();
line.x = PixelScene.align( (w - line.width()) / 2 );
line.y = PixelScene.align( pos );
line.x = (w - line.width()) / 2;
line.y = pos;
add( line );
pos += line.height();
@@ -184,10 +184,10 @@ public class WndCatalogus extends WndTabbed {
@Override
protected void layout() {
sprite.y = PixelScene.align( y + (height - sprite.height) / 2 );
sprite.y = y + (height - sprite.height) / 2;
label.x = sprite.x + sprite.width;
label.y = PixelScene.align( y + (height - label.baseLine()) / 2 );
label.y = y + (height - label.baseLine()) / 2;
}
public boolean onClick( float x, float y ) {
@@ -160,7 +160,7 @@ public class WndHero extends WndTabbed {
txt = PixelScene.createText( value, 8 );
txt.measure();
txt.x = PixelScene.align( WIDTH * 0.65f );
txt.x = 65;
txt.y = pos;
add( txt );
@@ -118,11 +118,11 @@ public class WndJournal extends Window {
icon.x = width - icon.width;
depth.x = icon.x - 1 - depth.width();
depth.y = PixelScene.align( y + (height - depth.height()) / 2 );
depth.y = y + (height - depth.height()) / 2;
icon.y = depth.y - 1;
feature.y = PixelScene.align( depth.y + depth.baseLine() - feature.baseLine() );
feature.y = depth.y + depth.baseLine() - feature.baseLine();
}
}
}
@@ -224,7 +224,7 @@ public class WndRanking extends WndTabbed {
txt = PixelScene.createText( value, 7 );
txt.measure();
txt.x = PixelScene.align( WIDTH * 0.65f );
txt.x = WIDTH * 0.65f;
txt.y = pos;
parent.add( txt );
@@ -214,8 +214,8 @@ public class WndTabbed extends Window {
protected void layout() {
super.layout();
btLabel.x = PixelScene.align( x + (width - btLabel.width()) / 2 );
btLabel.y = PixelScene.align( y + (height - btLabel.baseLine()) / 2 ) - 1;
btLabel.x = x + (width - btLabel.width()) / 2;
btLabel.y = y + (height - btLabel.baseLine()) / 2 - 1;
if (!selected) {
btLabel.y -= 2;
}