mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-12-28 10:35:29 +03:00
Fix Viewport X/Y Translation
The operands of the subtraction in the X/Y translation calculation were the wrong way around which led to negative translations that would translate the viewport off the screen.
This commit is contained in:
parent
f06a12170f
commit
353ca8ec84
@ -284,13 +284,13 @@ namespace skyline::gpu::interconnect {
|
||||
*/
|
||||
void SetViewportX(size_t index, float scale, float translate) {
|
||||
auto &viewport{viewports.at(index)};
|
||||
viewport.x = scale - translate; // Counteract the addition of the half of the width (o_x) to the host translation
|
||||
viewport.x = translate - scale; // Counteract the addition of the half of the width (o_x) to the host translation
|
||||
viewport.width = scale * 2.0f; // Counteract the division of the width (p_x) by 2 for the host scale
|
||||
}
|
||||
|
||||
void SetViewportY(size_t index, float scale, float translate) {
|
||||
auto &viewport{viewports.at(index)};
|
||||
viewport.y = scale - translate; // Counteract the addition of the half of the height (p_y/2 is center) to the host translation (o_y)
|
||||
viewport.y = translate - scale; // Counteract the addition of the half of the height (p_y/2 is center) to the host translation (o_y)
|
||||
viewport.height = scale * 2.0f; // Counteract the division of the height (p_y) by 2 for the host scale
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user