diff options
author | 2020-05-19 19:57:42 +0200 | |
---|---|---|
committer | 2020-05-19 19:57:42 +0200 | |
commit | a0ac09122a68d9be7d11e5cc765f52cb526ae913 (patch) | |
tree | 4a282e638c701812ac1ac9467bc9d0c068a6d1d4 /wgpu/src | |
parent | 750a441a8c7c76b240db238283e9cbdab8d6932d (diff) | |
download | iced-a0ac09122a68d9be7d11e5cc765f52cb526ae913.tar.gz iced-a0ac09122a68d9be7d11e5cc765f52cb526ae913.tar.bz2 iced-a0ac09122a68d9be7d11e5cc765f52cb526ae913.zip |
Move `Viewport` to `iced_graphics`
Diffstat (limited to 'wgpu/src')
-rw-r--r-- | wgpu/src/lib.rs | 4 | ||||
-rw-r--r-- | wgpu/src/viewport.rs | 29 |
2 files changed, 1 insertions, 32 deletions
diff --git a/wgpu/src/lib.rs b/wgpu/src/lib.rs index d2905bd0..99897e60 100644 --- a/wgpu/src/lib.rs +++ b/wgpu/src/lib.rs @@ -36,15 +36,13 @@ mod backend; mod quad; mod target; mod text; -mod viewport; -pub use iced_graphics::{Defaults, Primitive}; +pub use iced_graphics::{Defaults, Primitive, Viewport}; pub use wgpu; pub use backend::Backend; pub use settings::Settings; pub use target::Target; -pub use viewport::Viewport; #[doc(no_inline)] pub use widget::*; diff --git a/wgpu/src/viewport.rs b/wgpu/src/viewport.rs deleted file mode 100644 index 66242468..00000000 --- a/wgpu/src/viewport.rs +++ /dev/null @@ -1,29 +0,0 @@ -use crate::Transformation; - -/// A viewing region for displaying computer graphics. -#[derive(Debug)] -pub struct Viewport { - width: u32, - height: u32, - transformation: Transformation, -} - -impl Viewport { - /// Creates a new [`Viewport`] with the given dimensions. - pub fn new(width: u32, height: u32) -> Viewport { - Viewport { - width, - height, - transformation: Transformation::orthographic(width, height), - } - } - - /// Returns the dimensions of the [`Viewport`]. - pub fn dimensions(&self) -> (u32, u32) { - (self.width, self.height) - } - - pub(crate) fn transformation(&self) -> Transformation { - self.transformation - } -} |