diff --git a/js/ui/expoThumbnail.js b/js/ui/expoThumbnail.js index 41d576cfb0..7b4ab41e6a 100644 --- a/js/ui/expoThumbnail.js +++ b/js/ui/expoThumbnail.js @@ -117,7 +117,7 @@ var ExpoWindowClone = GObject.registerClass({ let clone = clones[i].actor; this.clone.add_actor(clone); let [width, height] = clone.get_size(); - clone.set_position(Math.round((pwidth - width) / 2), Math.round((pheight - height) / 2)); + clone.set_position((pwidth - width) / 2, (pheight - height) / 2); } } diff --git a/js/ui/ibusCandidatePopup.js b/js/ui/ibusCandidatePopup.js index c4048e3d74..300668a1fd 100644 --- a/js/ui/ibusCandidatePopup.js +++ b/js/ui/ibusCandidatePopup.js @@ -293,8 +293,8 @@ class IbusCandidatePopup extends BoxPointer.BoxPointer { } _setDummyCursorGeometry(x, y, w, h) { - this._dummyCursor.set_position(Math.round(x), Math.round(y)); - this._dummyCursor.set_size(Math.round(w), Math.round(h)); + this._dummyCursor.set_position(x, y); + this._dummyCursor.set_size(w, h); if (this.visible) this.setPosition(this._dummyCursor, 0); diff --git a/js/ui/magnifier.js b/js/ui/magnifier.js index cbc668a98e..b06f19f0bd 100644 --- a/js/ui/magnifier.js +++ b/js/ui/magnifier.js @@ -1223,13 +1223,13 @@ var ZoomRegion = class ZoomRegion { _setViewPort(viewPort, fromROIUpdate) { // Sets the position of the zoom region on the screen - let width = Math.round(Math.min(viewPort.width, global.screen_width)); - let height = Math.round(Math.min(viewPort.height, global.screen_height)); + let width = Math.min(viewPort.width, global.screen_width); + let height = Math.min(viewPort.height, global.screen_height); let x = Math.max(viewPort.x, 0); let y = Math.max(viewPort.y, 0); - x = Math.round(Math.min(x, global.screen_width - width)); - y = Math.round(Math.min(y, global.screen_height - height)); + x = Math.min(x, global.screen_width - width); + y = Math.min(y, global.screen_height - height); this._viewPortX = x; this._viewPortY = y; diff --git a/js/ui/modalDialog.js b/js/ui/modalDialog.js index 31e39b656d..9c268bd7dc 100644 --- a/js/ui/modalDialog.js +++ b/js/ui/modalDialog.js @@ -391,8 +391,8 @@ var InfoOSD = class { this.actor.opacity = 0; this.actor.show(); - let x = monitor.x + Math.round((monitor.width - this.actor.width)/2); - let y = monitor.y + Math.round((monitor.height - this.actor.height)/2); + let x = monitor.x + (monitor.width - this.actor.width) / 2; + let y = monitor.y + (monitor.height - this.actor.height) / 2; this.actor.set_position(x, y); this.actor.opacity = 255; diff --git a/js/ui/popupDialog.js b/js/ui/popupDialog.js index d7a090732a..08ebbbaabc 100644 --- a/js/ui/popupDialog.js +++ b/js/ui/popupDialog.js @@ -130,8 +130,8 @@ class PopupDialog extends BaseDialog.BaseDialog { this.opacity = 0; this.show(); - let x = monitor.x + Math.round((monitor.width - this.width) / 2); - let y = monitor.y + Math.round((monitor.height - this.height) / 2); + let x = monitor.x + (monitor.width - this.width) / 2; + let y = monitor.y + (monitor.height - this.height) / 2; this.set_position(x, y); } diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index 8077d3df6f..92cf6e2ded 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -2108,7 +2108,7 @@ var PopupMenu = class PopupMenu extends PopupMenuBase { } break; } - return [Math.round(xPos), Math.round(yPos)]; + return [xPos, yPos]; } _boxGetPreferredWidth (actor, forHeight, alloc) { @@ -2513,7 +2513,7 @@ var PopupComboMenu = class PopupComboMenu extends PopupMenuBase { let activeItem = this._getMenuItems()[this._activeItemPos]; let [sourceX, sourceY] = this.sourceActor.get_transformed_position(); - this.actor.set_position(Math.round(sourceX), Math.round(sourceY - activeItem.actor.y)); + this.actor.set_position(sourceX, sourceY - activeItem.actor.y); this.actor.raise_top(); diff --git a/js/ui/screensaver/screenShield.js b/js/ui/screensaver/screenShield.js index 1b87262d83..11f1e8d671 100644 --- a/js/ui/screensaver/screenShield.js +++ b/js/ui/screensaver/screenShield.js @@ -845,7 +845,7 @@ var ScreenShield = GObject.registerClass({ let x = monitor.x + (monitor.width - natWidth) / 2; let y = monitor.y + monitor.height - natHeight - padding; - this._keyboardBox.set_position(Math.floor(x), Math.floor(y)); + this._keyboardBox.set_position(x, y); this._keyboardBox.set_size(natWidth, natHeight); } } @@ -901,7 +901,7 @@ var ScreenShield = GObject.registerClass({ let x = sectorLeft + (sectorWidth - widgetWidth) / 2; let y = sectorTop + (sectorHeight - widgetHeight) / 2; - widget.set_position(Math.floor(x), Math.floor(y)); + widget.set_position(x, y); widget._isBeingPositioned = false; } @@ -1085,7 +1085,7 @@ var ScreenShield = GObject.registerClass({ let x = monitor.x + monitor.width - natWidth - padding; let y = monitor.y + padding; - this._infoPanel.set_position(Math.floor(x), Math.floor(y)); + this._infoPanel.set_position(x, y); } _positionWidgetByState(widget) { diff --git a/js/ui/tooltips.js b/js/ui/tooltips.js index 4ed1702a70..744cdc903a 100644 --- a/js/ui/tooltips.js +++ b/js/ui/tooltips.js @@ -357,21 +357,21 @@ PanelItemTooltip.prototype = { case St.Side.BOTTOM: panel = Main.panelManager.getPanel(monitor.index, PanelLoc.bottom); tooltipTop = monitor.y + monitor.height - tooltipHeight - panel.get_height(); - tooltipLeft = this.mousePosition[0] - Math.round(tooltipWidth / 2); + tooltipLeft = this.mousePosition[0] - tooltipWidth / 2; tooltipLeft = Math.max(tooltipLeft, monitor.x); tooltipLeft = Math.min(tooltipLeft, monitor.x + monitor.width - tooltipWidth); break; case St.Side.TOP: panel = Main.panelManager.getPanel(monitor.index, PanelLoc.top); tooltipTop = monitor.y + panel.get_height(); - tooltipLeft = this.mousePosition[0] - Math.round(tooltipWidth / 2); + tooltipLeft = this.mousePosition[0] - tooltipWidth / 2; tooltipLeft = Math.max(tooltipLeft, monitor.x); tooltipLeft = Math.min(tooltipLeft, monitor.x + monitor.width - tooltipWidth); break; case St.Side.LEFT: panel = Main.panelManager.getPanel(monitor.index, PanelLoc.left); tooltipTop = this._panelItem.actor.get_transformed_position()[1]; - tooltipTop += Math.round((this._panelItem.actor.height - tooltipHeight) / 2); + tooltipTop += (this._panelItem.actor.height - tooltipHeight) / 2; // Fix for the tooltip clipping outside the screen when it's very close to the top or bottom. if (tooltipTop < monitor.y) { @@ -386,7 +386,7 @@ PanelItemTooltip.prototype = { case St.Side.RIGHT: panel = Main.panelManager.getPanel(monitor.index, PanelLoc.right); tooltipTop = this._panelItem.actor.get_transformed_position()[1]; - tooltipTop += Math.round((this._panelItem.actor.height - tooltipHeight) / 2); + tooltipTop += (this._panelItem.actor.height - tooltipHeight) / 2; // Fix for the tooltip clipping outside the screen when it's very close to the top or bottom. if (tooltipTop < monitor.y) { diff --git a/js/ui/workspace.js b/js/ui/workspace.js index ea56cc6414..98ef37aff1 100644 --- a/js/ui/workspace.js +++ b/js/ui/workspace.js @@ -395,20 +395,20 @@ var WindowOverlay = GObject.registerClass({ button.remove_style_class_name('left'); button.add_style_class_name('right'); } - button.set_position(Math.round(buttonX), Math.round(buttonY)); + button.set_position(buttonX, buttonY); let borderX = cloneX - this.borderWidth; let borderY = cloneY - this.borderWidth; let borderWidth = cloneWidth + 2 * this.borderWidth; let borderHeight = cloneHeight + 2 * this.borderWidth; - border.set_position(Math.round(borderX), Math.round(borderY)); - border.set_size(Math.round(borderWidth), Math.round(borderHeight)); + border.set_position(borderX, borderY); + border.set_size(borderWidth, borderHeight); let [minW, captionWidth] = caption.get_preferred_width(-1); captionWidth = Math.min(maxWidth, captionWidth); let captionX = cloneX + (cloneWidth - captionWidth) / 2; let captionY = cloneY + cloneHeight + caption._spacing; - caption.set_position(Math.round(captionX), Math.round(captionY)); + caption.set_position(captionX, captionY); caption.width = captionWidth; } @@ -664,8 +664,8 @@ class WorkspaceMonitor extends Clutter.Actor { (height - topBorder - bottomBorder) / rect.height, 1.0); // This is magic - x = Math.floor(x + (width - scale * rect.width - rightBorder + leftBorder) / 2); - y = Math.floor(y + (height - scale * rect.height - bottomBorder + topBorder) / 2); + x = x + (width - scale * rect.width - rightBorder + leftBorder) / 2; + y = y + (height - scale * rect.height - bottomBorder + topBorder) / 2; return [x, y, scale]; } @@ -818,8 +818,8 @@ class WorkspaceMonitor extends Clutter.Actor { if (this._windows.length > 0) { placeholder.hide(); } else { - let x = this._monitor.x + Math.floor((this._monitor.width - placeholder.width)/2); - let y = this._monitor.y + Math.floor((this._monitor.height - placeholder.height)/2); + let x = this._monitor.x + (this._monitor.width - placeholder.width) / 2; + let y = this._monitor.y + (this._monitor.height - placeholder.height) / 2; placeholder.set_position(x, y); placeholder.show(); }