From 7c0908b29c9013081e5aa31a5f931bf2ef9c03c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Lemaire?= Date: Tue, 3 Feb 2015 01:00:00 +0100 Subject: [PATCH] Fixed a freeze when ValueBar was set to 0 --- src/scripts/view/common/ValueBar.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/scripts/view/common/ValueBar.ts b/src/scripts/view/common/ValueBar.ts index 9fd5ffb..7d62db9 100644 --- a/src/scripts/view/common/ValueBar.ts +++ b/src/scripts/view/common/ValueBar.ts @@ -39,8 +39,13 @@ module SpaceTac.View { // Update graphics representation update() { if (this.bar_sprite) { + var dest = this.proportional; + if (dest < 0.00001) { + dest = 0.00001; + } + var tween = this.game.tweens.create(this.bar_sprite.scale); - tween.to({x: this.proportional}); + tween.to({x: dest}); tween.start(); } }