mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 15:14:50 +00:00
Physical viewport calculation fix (#5055)
# Objective - Fixes early return when viewport is not set. This now matches the description of the function. ## Solution - Remove errant try `?`.
This commit is contained in:
parent
8e8cbcc623
commit
9095d2fb31
1 changed files with 5 additions and 1 deletions
|
@ -116,7 +116,11 @@ impl Camera {
|
|||
/// the full physical rect of the current [`RenderTarget`].
|
||||
#[inline]
|
||||
pub fn physical_viewport_rect(&self) -> Option<(UVec2, UVec2)> {
|
||||
let min = self.viewport.as_ref()?.physical_position;
|
||||
let min = self
|
||||
.viewport
|
||||
.as_ref()
|
||||
.map(|v| v.physical_position)
|
||||
.unwrap_or(UVec2::ZERO);
|
||||
let max = min + self.physical_viewport_size()?;
|
||||
Some((min, max))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue