fix openxr aspect ratio calculation (#430)
This commit is contained in:
@@ -97,13 +97,13 @@ impl OverlayWindowData<OpenXrOverlayData> {
|
||||
|
||||
let transform = state.transform * self.config.backend.frame_meta().unwrap().transform; // contract
|
||||
|
||||
let aspect_ratio = swapchain.extent[1] as f32 / swapchain.extent[0] as f32;
|
||||
let aspect_ratio = swapchain.extent[0] as f32 / swapchain.extent[1] as f32;
|
||||
let (scale_x, scale_y) = if aspect_ratio < 1.0 {
|
||||
let major = transform.matrix3.col(0).length();
|
||||
(major, major * aspect_ratio)
|
||||
(major * aspect_ratio, major)
|
||||
} else {
|
||||
let major = transform.matrix3.col(1).length();
|
||||
(major / aspect_ratio, major)
|
||||
(major, major / aspect_ratio)
|
||||
};
|
||||
|
||||
let flags = if state.additive {
|
||||
|
||||
Reference in New Issue
Block a user