After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 629950 - proportional tracking in magnifier is hard to use along the screen edges
proportional tracking in magnifier is hard to use along the screen edges
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: magnifier
unspecified
Other Linux
: High normal
: ---
Assigned To: Florian Müllner
gnome-shell-maint
Depends on: 633582
Blocks:
 
 
Reported: 2010-09-17 18:34 UTC by William Jon McCann
Modified: 2013-12-04 18:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot (104.44 KB, image/png)
2010-09-17 18:40 UTC, William Jon McCann
  Details
Top right with proportional mouse tracking (88.44 KB, image/jpeg)
2010-09-21 15:28 UTC, Joseph Scheuhammer
  Details
Improve the algorithm for proportional mouse tracking (1.93 KB, patch)
2010-11-14 22:27 UTC, Owen Taylor
committed Details | Review

Description William Jon McCann 2010-09-17 18:34:55 UTC
The proportional tracking in the magnifier is hard to use along the screen edges.  This is because it doesn't maintain enough periphery around the pointer.
Comment 1 William Jon McCann 2010-09-17 18:40:53 UTC
Created attachment 170510 [details]
screenshot

Here's a screenshot that hopefully shows why it is problematic.
Comment 2 William Jon McCann 2010-09-18 15:05:32 UTC
Something like this perhaps?

 const ScreenPosition = {
@@ -1124,10 +1124,12 @@ ZoomRegion.prototype = {
         let [xRoi, yRoi, widthRoi, heightRoi] = this.getROI();
         let halfScreenWidth = global.screen_width / 2;
         let halfScreenHeight = global.screen_height / 2;
-        let xProportion = (halfScreenWidth - xMouse) / halfScreenWidth;
-        let yProportion = (halfScreenHeight - yMouse) / halfScreenHeight;
-        let xPos = xMouse + xProportion * widthRoi / 2;
-        let yPos = yMouse + yProportion * heightRoi / 2;
+        let xPadding = global.screen_width / 10;
+        let yPadding = global.screen_height / 10;
+        let xProportion = (halfScreenWidth - xMouse) / (halfScreenWidth - xPadding);
+        let yProportion = (halfScreenHeight - yMouse) / (halfScreenHeight - yPadding);
+        let xPos = (xMouse - xProportion * xPadding) + xProportion * widthRoi / 2;
+        let yPos = (yMouse - yProportion * yPadding) + yProportion * heightRoi / 2;
 
         this._scrollToPosition(xPos, yPos);
     },
Comment 3 Florian Müllner 2010-09-20 22:39:32 UTC
(In reply to comment #2)
> Something like this perhaps?
> -        let yProportion = (halfScreenHeight - yMouse) / halfScreenHeight;
> -        let xPos = xMouse + xProportion * widthRoi / 2;
> -        let yPos = yMouse + yProportion * heightRoi / 2;
> +        let xPos = (xMouse - xProportion * xPadding) + xProportion * widthRoi
> / 2;
> +        let yPos = (yMouse - yProportion * yPadding) + yProportion * heightRoi
> / 2;

I think it's confusing to "pad" the position (especially with the unnecessary parenthesis). Does it make sense to write this as follows?

let xPos = xMouse + (widthRoi / 2 - xPadding) * xProportion;
let yPos = yMouse + (heightRoi / 2 - yPadding) * yProportion;
Comment 4 Joseph Scheuhammer 2010-09-21 15:28:35 UTC
Created attachment 170762 [details]
Top right with proportional mouse tracking

(In reply to comment #1)
> Created an attachment (id=170510) [details]
> screenshot
> 
> Here's a screenshot that hopefully shows why it is problematic.

I see what you are saying, and have been experimenting with possible solutions.  One (partial) fix is simply using the full screen size and not halving it at the beginning of the calculation.  "PropRight.jpg" is a screen shot of what happens in that case.  How does it look?

Misgivings:  Using this technique, I don't see similar "padding" on the top-left, and I'm not sure if the magnification factor interacts with this in some way.

I think what you want is for proportional tracking to stop near the edge, and behave similar to the way centred tracking does (near the edge).
Comment 5 Joseph Scheuhammer 2010-09-21 16:57:02 UTC
I just tried o(In reply to comment #2)
> Something like this perhaps?

I tried your padding solution.  It's much better than the suggestion I made above.
Comment 6 William Jon McCann 2010-11-07 11:28:04 UTC
Anyone want to cook up a patch for this?  More important now since this is the default mode.
Comment 7 Owen Taylor 2010-11-14 22:27:29 UTC
Created attachment 174464 [details] [review]
Improve the algorithm for proportional mouse tracking

Here's my attempt to turn things into a patch. Changes:

 - Made the padding region dependent to the zoom factor so it wouldn't
   be a larger fraction of the ROI at higher zoom levels.
   (Try, say, gsettings set org.gnome.accessibility.magnifier mag-factor 4
   to see the effect)

 - Switched the sign on xProportion/yProportion, since the existing
   convention was hurting my head, Positive numbers increase towards the
   left!

 - Used the screen height for both X and Y padding, since it seems like
   the factors determining padding size would be the same in the X and Y
   directions.

The patch depends upon my ZoomRegion refactor in bug 633582.
Comment 8 Florian Müllner 2010-11-17 18:26:23 UTC
Review of attachment 174464 [details] [review]:

Looks good. Jon, can you confirm that this is the behaviour you want while the required patch is pending review?
Comment 9 Owen Taylor 2010-12-03 19:27:43 UTC
Fixed with algorithm changes for computing the padding in the non-full-screen discussed and tested on IRC.

Attachment 174464 [details] pushed as 96fb6d8 - Improve the algorithm for proportional mouse tracking