wplot/sys/drawing/
rect_change_region.rs

1/// Internal namespace.
2pub( crate ) mod private
3{
4  use crate::protected::*;
5
6  /// Command to draw rectangle.
7  #[ allow( dead_code ) ]
8  #[ derive( Debug, Clone ) ]
9  pub struct RectChangeRegion
10  {
11    /// Id.
12    pub( crate ) id : Id,
13    /// Left-top corner.
14    pub( crate ) left_top : X2< f32 >,
15    /// Right-bottom corner.
16    pub( crate )  right_bottom : X2< f32 >,
17  }
18
19  impl RectChangeRegion
20  {
21
22    /// Constructor
23    pub fn new( id : Id ) -> Self
24    {
25      let left_top = X2::make( -1.0, -1.0 );
26      let right_bottom = X2::make( 1.0, 1.0 );
27      Self{ left_top, right_bottom, id }
28    }
29
30    /// Constructor
31    pub fn region( mut self, left_top : X2< f32 >, right_bottom : X2< f32 > ) -> Self
32    {
33      self.left_top = left_top;
34      self.right_bottom = right_bottom;
35      self
36    }
37
38  }
39
40  impl ChangeInterface for RectChangeRegion
41  {
42  }
43
44}
45
46crate::mod_interface!
47{
48  exposed use RectChangeRegion;
49}