diff options
author | Ville Hakulinen <ville.hakulinen@gmail.com> | 2020-07-03 17:50:32 +0300 |
---|---|---|
committer | Ville Hakulinen <ville.hakulinen@gmail.com> | 2020-07-12 01:57:30 +0300 |
commit | f44c25e871eeebc1fdbbfc6419c232e0fd3a83f1 (patch) | |
tree | 7a942eb058f7c0ad87a44c6d895e903ba65d6806 | |
parent | 69d0cca6b321e83da889f914a48dac50c5ff0eed (diff) |
Limit float window size to base grid size
-rw-r--r-- | src/ui/state.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ui/state.rs b/src/ui/state.rs index 816caaa..e529f6b 100644 --- a/src/ui/state.rs +++ b/src/ui/state.rs @@ -572,13 +572,13 @@ impl UIState { x_offset + anchor_metrics.cell_width * evt.anchor_col } else { x_offset + anchor_metrics.cell_width * evt.anchor_col - }; + }.max(0.0); let y = if evt.anchor.is_north() { y_offset + anchor_metrics.cell_height * evt.anchor_row } else { y_offset + anchor_metrics.cell_height * evt.anchor_row - }; + }.max(0.0); let base_grid = self.grids.get(&1).unwrap(); let base_metrics = base_grid.get_grid_metrics(); |