diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/HealthBar.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/HealthBar.java index 63c2fd658..8e803045c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/HealthBar.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/HealthBar.java @@ -61,8 +61,12 @@ public class HealthBar extends Component { Bg.y = Shld.y = Hp.y = y; Bg.size( width, HEIGHT ); - Shld.size( width * shield, HEIGHT ); - Hp.size( width * health, HEIGHT ); + + //logic here rounds up to the nearest pixel + float pixelWidth = width; + if (camera() != null) pixelWidth *= camera().zoom; + Shld.size( width * (float)Math.ceil(shield * pixelWidth)/pixelWidth, HEIGHT ); + Hp.size( width * (float)Math.ceil(health * pixelWidth)/pixelWidth, HEIGHT ); height = HEIGHT; }