Vita: Fixed absence of clipping when viewport is set
Resolves a problem of viewport on the Vita set by SDL_RenderSetViewport() that doesn't sets any clipping by default.
How it looked before the fix:
How it supposed to look everywhere (after fix):
Description
This solution sets the cliprect in shadow when real cliprect is unused. And when cliprect gets reset, the viewport's rect gets set when viewport is set (the width and height gets compared to the size of the drawable area such as screen or texture).
Existing Issue(s)
#13034
This fix is much better than the existing behavior, but I think it might not handle the case where a manually-specified clip rect is larger than the viewport.
This fix is much better than the existing behavior, but I think it might not handle the case where a manually-specified clip rect is larger than the viewport.
A good case, then it's need to cut down the clip rect when viewport is set, and rectangle is out of viewport's range.
@slouken, ping? I also made the limiting of the scope so true croprect will never go out of viewport's range. And I tested that behaviour on my end already. Now it should be ready to merge, but if any objections, please tell me what I should to change in the code, and I'll apply that as fast as possible.
I went ahead and merged this. Can you make a similar PR for SDL3?
I went ahead and merged this. Can you make a similar PR for SDL3?
Let me make an attempt...