Skip to content

Commit d484a9c

Browse files
SG-40392: Fix Presentation mode's Pointer option issue on High-DPI monitors (AcademySoftwareFoundation#1048)
### SG-40392: Fix Presentation mode's Pointer option issue on High-DPI monitors ### Linked issues NA ### Describe the reason for the change. The presentation mode's Pointer option (disabled by default) did not support high-DPI displays ### Summarize your change. Added support for high-DPI displays when drawing the presentation mode's pointers, ### Describe what you have tested and on which operating system. Successfully tested on macOS + NDI ### 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 <bernard.laberge@autodesk.com>
1 parent 80deb73 commit d484a9c

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/lib/app/mu_rvui/extra_commands.mu

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,8 @@ require system;
281281

282282
if (sourceName != "")
283283
{
284-
let normalizedIP = eventToImageSpace(sourceName, p, true);
284+
let devicePixelRatio = devicePixelRatio(),
285+
normalizedIP = eventToImageSpace(sourceName, p*devicePixelRatio, true);
285286
state.pointerPositionNormalized = normalizedIP;
286287
}
287288
}

src/lib/app/mu_rvui/presentation_mode.mu

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,20 +136,21 @@ class: PresentationControlMinorMode : MinorMode
136136
method: move (void; Event event)
137137
{
138138
event.reject();
139-
State state = data();
140-
state.perPixelInfoValid = false;
139+
State state = data();
140+
state.perPixelInfoValid = false;
141141
}
142142

143143
method: _drawCross (void; Point p, float t)
144144
{
145-
let x0 = Vec2(2, 0),
146-
x1 = Vec2(10, 0),
147-
y0 = Vec2(0, 2),
148-
y1 = Vec2(0, 10);
145+
let devicePixelRatio = devicePixelRatio(),
146+
x0 = Vec2(2*devicePixelRatio, 0),
147+
x1 = Vec2(10*devicePixelRatio, 0),
148+
y0 = Vec2(0, 2*devicePixelRatio),
149+
y1 = Vec2(0, 10*devicePixelRatio);
149150

150151
float f = t/2.0;
151152

152-
glLineWidth(3.0);
153+
glLineWidth(3.0*devicePixelRatio);
153154

154155
glColor(0.5-t,0.5-t,0.5-t,1);
155156

@@ -160,7 +161,7 @@ class: PresentationControlMinorMode : MinorMode
160161
glVertex(p - y0); glVertex(p - y1);
161162
glEnd();
162163

163-
glLineWidth(1.0);
164+
glLineWidth(1.0*devicePixelRatio);
164165
glColor(0.5+t,0.5+t,0.5+t,1);
165166

166167
glBegin(GL_LINES);

0 commit comments

Comments
 (0)