screenshot: use integer coordinates

This fixes the shivery selection rectangle when making a region
screenshot.

https://bugzilla.gnome.org/show_bug.cgi?id=746223
This commit is contained in:
Clément Guérin 2015-03-14 23:45:11 +01:00 committed by Jasper St. Pierre
parent a5b7eaec1a
commit fa4f6c4561

View File

@ -292,6 +292,8 @@ const SelectArea = new Lang.Class({
return Clutter.EVENT_PROPAGATE; return Clutter.EVENT_PROPAGATE;
[this._lastX, this._lastY] = event.get_coords(); [this._lastX, this._lastY] = event.get_coords();
this._lastX = Math.floor(this._lastX);
this._lastY = Math.floor(this._lastY);
let geometry = this._getGeometry(); let geometry = this._getGeometry();
this._rubberband.set_position(geometry.x, geometry.y); this._rubberband.set_position(geometry.x, geometry.y);
@ -302,6 +304,8 @@ const SelectArea = new Lang.Class({
_onButtonPress: function(actor, event) { _onButtonPress: function(actor, event) {
[this._startX, this._startY] = event.get_coords(); [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); this._rubberband.set_position(this._startX, this._startY);
return Clutter.EVENT_PROPAGATE; return Clutter.EVENT_PROPAGATE;