mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-25 07:09:48 -06:00
Renderer: Adjust source rectangle when crop would draw off screen
This prevents us from requiring an oversized and/or negative viewport by shrinking the source rectangle instead.
This commit is contained in:
@ -171,6 +171,13 @@ public:
|
||||
const MathUtil::Rectangle<int>& GetTargetRectangle() const { return m_target_rectangle; }
|
||||
float CalculateDrawAspectRatio() const;
|
||||
|
||||
// Crops the target rectangle to the framebuffer dimensions, reducing the size of the source
|
||||
// rectangle if it is greater. Works even if the source and target rectangles don't have a
|
||||
// 1:1 pixel mapping, scaling as appropriate.
|
||||
void AdjustRectanglesToFitBounds(MathUtil::Rectangle<int>* target_rect,
|
||||
MathUtil::Rectangle<int>* source_rect, int fb_width,
|
||||
int fb_height);
|
||||
|
||||
std::tuple<float, float> ScaleToDisplayAspectRatio(int width, int height) const;
|
||||
void UpdateDrawRectangle();
|
||||
|
||||
|
Reference in New Issue
Block a user