Skip to content

Commit

Permalink
Explain Camera physical size is in pixel
Browse files Browse the repository at this point in the history
  • Loading branch information
stepancheg committed Jan 3, 2024
1 parent 0275508 commit 9bd90b2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/bevy_render/src/camera/camera.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl Default for Viewport {
/// Information about the current [`RenderTarget`].
#[derive(Default, Debug, Clone)]
pub struct RenderTargetInfo {
/// The physical size of this render target (ignores scale factor).
/// The physical size of this render target (in pixels).
pub physical_size: UVec2,
/// The scale factor of this render target.
pub scale_factor: f32,
Expand Down Expand Up @@ -193,7 +193,7 @@ impl Camera {
.or_else(|| self.logical_target_size())
}

/// The physical size of this camera's viewport. If the `viewport` field is set to [`Some`], this
/// The physical size of this camera's viewport (in pixels). If the `viewport` field is set to [`Some`], this
/// will be the size of that custom viewport. Otherwise it will default to the full physical size of
/// the current [`RenderTarget`].
/// For logic that requires the full physical size of the [`RenderTarget`], prefer [`Camera::physical_target_size`].
Expand All @@ -216,7 +216,7 @@ impl Camera {
.and_then(|t| self.to_logical(t.physical_size))
}

/// The full physical size of this camera's [`RenderTarget`], ignoring custom `viewport` configuration.
/// The full physical size of this camera's [`RenderTarget`] (in pixels), ignoring custom `viewport` configuration.
/// Note that if the `viewport` field is [`Some`], this will not represent the size of the rendered area.
/// For logic that requires the size of the actually rendered area, prefer [`Camera::physical_viewport_size`].
#[inline]
Expand Down

0 comments on commit 9bd90b2

Please sign in to comment.