Open Bug 1288387 Opened 8 years ago Updated 2 years ago

Make the new eyedropper highlighter deal correctly with changing dPR

Categories

(DevTools :: Inspector, defect, P2)

49 Branch
defect

Tracking

(Not tracked)

People

(Reporter: pbro, Unassigned)

References

(Blocks 1 open bug)

Details

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);
> ```
Inspector bug triage (filter on CLIMBING SHOES).
Priority: -- → P2
Product: Firefox → DevTools
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.