File tree Expand file tree Collapse file tree
libraries/display-plugins/src/display-plugins/hmd Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -214,14 +214,16 @@ void HmdDisplayPlugin::internalPresent() {
214214 float newWidth = sourceSize.x - shiftLeftBy;
215215
216216 // Experimentally adjusted the region presented in preview to avoid seeing the masked pixels and recenter the center...
217- static float SCALE_WIDTH = 0 . 8f ;
217+ static float SCALE_WIDTH = 1 . 0f ;
218218 static float SCALE_OFFSET = 2 .0f ;
219219 newWidth *= SCALE_WIDTH ;
220220 shiftLeftBy *= SCALE_OFFSET ;
221221
222- const unsigned int RATIO_Y = 9 ;
223- const unsigned int RATIO_X = 16 ;
224- glm::uvec2 originalClippedSize { newWidth, newWidth * RATIO_Y / RATIO_X };
222+ auto window = _container->getPrimaryWidget ();
223+
224+ auto ratioY = window->size ().height ();
225+ auto ratioX = window->size ().width ();
226+ glm::uvec2 originalClippedSize { newWidth, newWidth * ratioY / ratioX };
225227
226228 glm::ivec4 viewport = getViewportForSourceSize (sourceSize);
227229 glm::ivec4 scissor = viewport;
@@ -231,7 +233,6 @@ void HmdDisplayPlugin::internalPresent() {
231233 render ([&](gpu::Batch& batch) {
232234
233235 if (_monoPreview) {
234- auto window = _container->getPrimaryWidget ();
235236 float devicePixelRatio = window->devicePixelRatio ();
236237 glm::vec2 windowSize = toGlm (window->size ());
237238 windowSize *= devicePixelRatio;
You can’t perform that action at this time.
0 commit comments