VideoCommon/RenderBase: Fix crop

This fixes some mistakes from #8049 that caused crop to behave like
stretch and have a funny offset.
This commit is contained in:
Techjar 2019-06-18 18:33:44 -04:00
parent 7dbfcb6870
commit 08421db52f
1 changed files with 3 additions and 3 deletions

View File

@ -585,8 +585,8 @@ void Renderer::AdjustRectanglesToFitBounds(MathUtil::Rectangle<int>* target_rect
if (target_rect->bottom > fb_height) if (target_rect->bottom > fb_height)
{ {
const int offset = target_rect->bottom - fb_height; const int offset = target_rect->bottom - fb_height;
target_rect->right -= offset; target_rect->bottom -= offset;
source_rect->right -= offset * orig_source_height / orig_target_height; source_rect->bottom -= offset * orig_source_height / orig_target_height;
} }
} }
@ -1259,7 +1259,7 @@ void Renderer::Swap(u32 xfb_addr, u32 fb_width, u32 fb_stride, u32 fb_height, u6
// Adjust the source rectangle instead of using an oversized viewport to render the XFB. // Adjust the source rectangle instead of using an oversized viewport to render the XFB.
auto render_target_rc = GetTargetRectangle(); auto render_target_rc = GetTargetRectangle();
auto render_source_rc = xfb_rect; auto render_source_rc = xfb_rect;
AdjustRectanglesToFitBounds(&render_target_rc, &xfb_rect, m_backbuffer_width, AdjustRectanglesToFitBounds(&render_target_rc, &render_source_rc, m_backbuffer_width,
m_backbuffer_height); m_backbuffer_height);
RenderXFBToScreen(render_target_rc, xfb_entry->texture.get(), render_source_rc); RenderXFBToScreen(render_target_rc, xfb_entry->texture.get(), render_source_rc);