From fa4f6c456126ba3e20a57c3a4038512a2fbf533e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Gu=C3=A9rin?= Date: Sat, 14 Mar 2015 23:45:11 +0100 Subject: [PATCH] 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 file changed, 4 insertions(+) diff --git a/js/ui/screenshot.js b/js/ui/screenshot.js index 45f013c8e..50c5f9d07 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;