[gnome-shell] osdWindow: Fix blurry level bar



commit 424fa01ecaf137680688c8e0977a8bdd88711b18
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Jul 1 18:54:03 2016 +0200

    osdWindow: Fix blurry level bar
    
    ClutterActor:width is a floating point property, so it will not be
    automatically rounded to non-fractional values that properly align
    to pixels. To fix the resulting blurriness, add explicit rounding.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=768317

 js/ui/osdWindow.js |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/osdWindow.js b/js/ui/osdWindow.js
index c33e937..4fd0c18 100644
--- a/js/ui/osdWindow.js
+++ b/js/ui/osdWindow.js
@@ -39,7 +39,7 @@ const LevelBar = new Lang.Class({
         this._level = Math.max(0, Math.min(value, 100));
 
         let alloc = this.actor.get_allocation_box();
-        let newWidth = (alloc.x2 - alloc.x1) * this._level / 100;
+        let newWidth = Math.round((alloc.x2 - alloc.x1) * this._level / 100);
         if (newWidth != this._bar.width)
             this._bar.width = newWidth;
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]