Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renderer: Adjust source rectangle when crop would draw off screen #8049

Open
wants to merge 2 commits into
base: master
from

Conversation

2 participants
@stenzek
Copy link
Contributor

commented Apr 28, 2019

This prevents us from requiring an oversized and/or negative viewport by shrinking the source rectangle instead.

Should be tested by someone more familiar with the setting and its effects, as AFAICT it was producing the same results, but probably didn't check all scenarios.

// 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,

This comment has been minimized.

Copy link
@jordan-woyak

jordan-woyak Apr 28, 2019

Member

Our code-style says to pass pointers to objects that will be modified (for clarity at the call-site) rather than by-ref.
Athough it is pretty clear based on the name of this function.

This comment has been minimized.

Copy link
@stenzek

stenzek Apr 28, 2019

Author Contributor

Ehh, consistency is best. Changed :)

stenzek added some commits Apr 28, 2019

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.

@stenzek stenzek force-pushed the stenzek:crop branch from db68cc3 to 32359bf Apr 28, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.