mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-01 05:38:50 +00: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:
parent
d2d8d7ce90
commit
3c64f0c616
4 changed files with 57 additions and 10 deletions
|
@ -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();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue