Skip to content

Commit da5b652

Browse files
Fix drop region for High-DPI displays (#889) (#890)
### 889: Fix drop region for High-DPI displays ### Linked issues Fixes #889 ### Describe the reason for the change. Could not add new content sources via drag and drop when a source is already loaded on High-DPI displays ### Summarize your change. Now taking devicePixelRatio (High-DPI display) into account in drawDropRegions() mu method. ### Describe what you have tested and on which operating system. Successfully tested on macOS ### Add a list of changes, and note any that might need special attention during the review. ### If possible, provide screenshots. Signed-off-by: Bernard Laberge <[email protected]>
1 parent 6ab0a2a commit da5b652

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/lib/app/mu_rvui/glyph.mu

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,15 @@ operator: & (Glyph; Glyph a, Glyph b)
528528
bsize = (h - m[2] - m[3]) / descriptors.size(),
529529
inregion = -1;
530530

531+
// Take device pixel ratio into account
532+
// Note that w and h come from the domain.x and domain.y respectively which
533+
// is the resolution in pixels of the viewable area that is already adjusted
534+
// for devicePixelRatio, whereas x and y are mouse pointers which are not
535+
// adjusted for devicePixelRatio.
536+
x *= devicePixelRatio;
537+
y *= devicePixelRatio;
538+
margin *= devicePixelRatio;
539+
531540
for_index (i; descriptors)
532541
{
533542
gltext.size(20*devicePixelRatio);

0 commit comments

Comments
 (0)