aboutsummaryrefslogtreecommitdiff
path: root/src/gui/dimension_indicator.rs
diff options
context:
space:
mode:
authorArne Dußin2021-01-06 22:44:08 +0100
committerGitHub2021-01-06 22:44:08 +0100
commit30b23db9e86fdf72a4e7de72213df274ce19123e (patch)
treeb06b5bf6a21e64ff1bfafff90861532e651352d5 /src/gui/dimension_indicator.rs
parent0eada0bdcb36a9907c6c928aa707ed6bef03c02f (diff)
parent53d376eaeef991850d35318b147f75c8f103319d (diff)
downloadgraf_karto-30b23db9e86fdf72a4e7de72213df274ce19123e.tar.gz
graf_karto-30b23db9e86fdf72a4e7de72213df274ce19123e.zip
Merge pull request #25 from LordSentox/better-polygons
Change to polygongraph instead of polygon in roomtool
Diffstat (limited to 'src/gui/dimension_indicator.rs')
-rw-r--r--src/gui/dimension_indicator.rs20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/gui/dimension_indicator.rs b/src/gui/dimension_indicator.rs
index e8848fe..57f5bcc 100644
--- a/src/gui/dimension_indicator.rs
+++ b/src/gui/dimension_indicator.rs
@@ -41,22 +41,28 @@ impl Default for State {
}
}
+impl Default for DimensionIndicator {
+ fn default() -> Self {
+ Self {
+ state: State::default(),
+ bounds: Rect::new(0., 0., 0., 0.),
+ }
+ }
+}
+
impl DimensionIndicator {
/// Create a new dimension indicator. While it is possible to have multiple instances, this is
/// not generally recommended, since they will need to be managed carefully or otherwise steal
/// keystrokes from each other.
pub fn new() -> Self {
- Self {
- state: State::default(),
- bounds: Rect::new(0., 0., 0., 0.),
- }
+ Self::default()
}
/// Update whatever is selected on the map according to the dimension indicator rules and rulers.
pub fn update(&mut self, map: &mut Map, rl: &mut RaylibHandle) {
- match &self.state {
- &State::Watching => self.update_watching(map, rl),
- &State::Ruling { .. } => self.update_ruling(map, rl),
+ match self.state {
+ State::Watching => self.update_watching(map, rl),
+ State::Ruling { .. } => self.update_ruling(map, rl),
};
}