summaryrefslogtreecommitdiffstats
path: root/graphics/src/viewport.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-05-28 01:37:59 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-05-28 01:40:30 +0200
commit2ca7e3c4b0cb293adebf9a9bf9a26191069d495d (patch)
tree653a1f24422079231ff5a9f0d868c7d117ca92ed /graphics/src/viewport.rs
parent45511a442f707e93fe6e568d2100756b63af7362 (diff)
downloadiced-2ca7e3c4b0cb293adebf9a9bf9a26191069d495d.tar.gz
iced-2ca7e3c4b0cb293adebf9a9bf9a26191069d495d.tar.bz2
iced-2ca7e3c4b0cb293adebf9a9bf9a26191069d495d.zip
Write documentation for `iced_graphics`
Diffstat (limited to 'graphics/src/viewport.rs')
-rw-r--r--graphics/src/viewport.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/graphics/src/viewport.rs b/graphics/src/viewport.rs
index 745ef339..66122e6d 100644
--- a/graphics/src/viewport.rs
+++ b/graphics/src/viewport.rs
@@ -26,22 +26,44 @@ impl Viewport {
}
}
+ /// Returns the physical size of the [`Viewport`].
+ ///
+ /// [`Viewport`]: struct.Viewport.html
pub fn physical_size(&self) -> Size<u32> {
self.physical_size
}
+ /// Returns the physical width of the [`Viewport`].
+ ///
+ /// [`Viewport`]: struct.Viewport.html
+ pub fn physical_width(&self) -> u32 {
+ self.physical_size.height
+ }
+
+ /// Returns the physical height of the [`Viewport`].
+ ///
+ /// [`Viewport`]: struct.Viewport.html
pub fn physical_height(&self) -> u32 {
self.physical_size.height
}
+ /// Returns the logical size of the [`Viewport`].
+ ///
+ /// [`Viewport`]: struct.Viewport.html
pub fn logical_size(&self) -> Size<f32> {
self.logical_size
}
+ /// Returns the scale factor of the [`Viewport`].
+ ///
+ /// [`Viewport`]: struct.Viewport.html
pub fn scale_factor(&self) -> f64 {
self.scale_factor
}
+ /// Returns the projection transformation of the [`Viewport`].
+ ///
+ /// [`Viewport`]: struct.Viewport.html
pub fn projection(&self) -> Transformation {
self.projection
}