[gnome-shell] screenshot: use integer coordinates



commit fa4f6c456126ba3e20a57c3a4038512a2fbf533e
Author: Clément Guérin <geecko dev free fr>
Date:   Sat Mar 14 23:45:11 2015 +0100

    screenshot: use integer coordinates
    
    This fixes the shivery selection rectangle when making a region
    screenshot.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=746223

 js/ui/screenshot.js |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/screenshot.js b/js/ui/screenshot.js
index 45f013c..50c5f9d 100644
--- a/js/ui/screenshot.js
+++ b/js/ui/screenshot.js
@@ -292,6 +292,8 @@ const SelectArea = new Lang.Class({
             return Clutter.EVENT_PROPAGATE;
 
         [this._lastX, this._lastY] = event.get_coords();
+        this._lastX = Math.floor(this._lastX);
+        this._lastY = Math.floor(this._lastY);
         let geometry = this._getGeometry();
 
         this._rubberband.set_position(geometry.x, geometry.y);
@@ -302,6 +304,8 @@ const SelectArea = new Lang.Class({
 
     _onButtonPress: function(actor, event) {
         [this._startX, this._startY] = event.get_coords();
+        this._startX = Math.floor(this._startX);
+        this._startY = Math.floor(this._startY);
         this._rubberband.set_position(this._startX, this._startY);
 
         return Clutter.EVENT_PROPAGATE;


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