From ae24b0247e90aba85366b7364f7061f4ce467dc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=D0=93=D1=80=D0=B8?= =?UTF-8?q?=D1=86=D0=B5=D0=BD=D0=BA=D0=BE?= Date: Mon, 29 May 2023 17:42:13 +0300 Subject: [PATCH] magnifier: Fix cursor offset Commit c449058d447c2588d changed the pointer clone to use a single actor. However that broke applying the hotspot translation to the position, so the magnified cursor is now displayed with a shift. Undo the change to restore the old behavior. This reverts commit c449058d447c2588de81df2e2bd7a1ae98c4060f. Part-of: --- js/ui/magnifier.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/ui/magnifier.js b/js/ui/magnifier.js index f4012dedf..bd6904758 100644 --- a/js/ui/magnifier.js +++ b/js/ui/magnifier.js @@ -103,12 +103,15 @@ var Magnifier = class Magnifier extends Signals.EventEmitter { this._mouseSprite = new Clutter.Actor({ request_mode: Clutter.RequestMode.CONTENT_SIZE }); this._mouseSprite.content = new MouseSpriteContent(); + this._cursorRoot = new Clutter.Actor(); + this._cursorRoot.add_actor(this._mouseSprite); + // Create the first ZoomRegion and initialize it according to the // magnification settings. [this.xMouse, this.yMouse] = global.get_pointer(); - let aZoomRegion = new ZoomRegion(this, this._mouseSprite); + let aZoomRegion = new ZoomRegion(this, this._cursorRoot); this._zoomRegions.push(aZoomRegion); this._settingsInit(aZoomRegion); aZoomRegion.scrollContentsTo(this.xMouse, this.yMouse); @@ -283,7 +286,7 @@ var Magnifier = class Magnifier extends Signals.EventEmitter { * @returns {ZoomRegion} the newly created ZoomRegion. */ createZoomRegion(xMagFactor, yMagFactor, roi, viewPort) { - let zoomRegion = new ZoomRegion(this, this._mouseSprite); + let zoomRegion = new ZoomRegion(this, this._cursorRoot); zoomRegion.setViewPort(viewPort); // We ignore the redundant width/height on the ROI