![]() # Objective In its existing form, the clamping that's done in `camera_system` doesn't work well when the `physical_position` of the associated viewport is nonzero. In such cases, it may produce invalid viewport rectangles (i.e. not lying inside the render target), which may result in crashes during the render pass. The goal of this PR is to eliminate this possibility by making the clamping behavior always result in a valid viewport rectangle when possible. ## Solution Incorporate the `physical_position` information into the clamping behavior. In particular, always cut off enough so that it's contained in the render target rather than clamping it to the same dimensions as the target itself. In weirder situations, still try to produce a valid viewport rectangle to avoid crashes. ## Testing Tested these changes on my work branch where I encountered the crash. |
||
---|---|---|
.. | ||
macros | ||
src | ||
Cargo.toml | ||
LICENSE-APACHE | ||
LICENSE-MIT | ||
README.md |