bugzilla.mozilla.org will be intermittently unavailable on Saturday, March 24th, from 16:00 until 20:00 UTC.

Make the new eyedropper highlighter deal correctly with changing dPR




Developer Tools: Inspector
2 years ago
7 months ago


(Reporter: pbro, Unassigned)


(Blocks: 1 bug)

49 Branch
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)




2 years ago
Right now the new eyedropper introduced in bug 1262439 somewhat deals with zoom changes (when the zoom changes, at least it keeps on picking the right pixels when you move your mouse).
But it doesn't deal at all with changing pixel ratio.

This may happen if you drag your window from a monitor to another one, and if these monitor have different pixel ratios.

From bug 1262439 comment 57:

> That handles only the zoom, where I believe we should handles the change of
> DPPX in any case: that also includes if the user is moving windows between
> monitor with different display density, and / or if it's changes the
> settings of the current one (definitely possible in OS X, and also in
> Windows).
> A code like that should be able to deal with both cases (zoom and display
> density):
> ```
>     function onDPRChange(window) {
>         let dpr = window.devicePixelRatio;
>         let mql = window.matchMedia(`(resolution:${dpr}dppx)`);
>         function listener() {
>           // do your stuff here
>           // ...
>           // set again the trigger for a next change
>           onDPRChange(window);
>         };
>         mql.addListener(listener);
>     }
>     // set for the first time
>     onDPRChange(highlighterEnv.window);
> ```

Comment 1

2 years ago
Inspector bug triage (filter on CLIMBING SHOES).
Priority: -- → P2
Blocks: 1333358
You need to log in before you can comment on or make changes to this bug.