summaryrefslogtreecommitdiffstats
path: root/src/canvas/widgets/mem_basic.rs
diff options
context:
space:
mode:
authorClement Tsang <34804052+ClementTsang@users.noreply.github.com>2021-04-23 19:31:35 -0400
committerGitHub <noreply@github.com>2021-04-23 19:31:35 -0400
commitfcc478a1eb978c826ac416399813df7cdc6b94b2 (patch)
tree438c738f559036d536bed031945a7d30cf340233 /src/canvas/widgets/mem_basic.rs
parent280bcbead2e0bdb8ae94d0ab5b8232f7c4fbec31 (diff)
bug: Fixes basic mode mouse hitboxes being broken (#458)
Fixes basic mode having broken click hitboxes (they were 1 unit too long in both directions). I'm pretty sure normal mode does too, but it's less noticeable due to bounding boxes.
Diffstat (limited to 'src/canvas/widgets/mem_basic.rs')
-rw-r--r--src/canvas/widgets/mem_basic.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/canvas/widgets/mem_basic.rs b/src/canvas/widgets/mem_basic.rs
index 3bb40ad7..b252c5d3 100644
--- a/src/canvas/widgets/mem_basic.rs
+++ b/src/canvas/widgets/mem_basic.rs
@@ -122,8 +122,10 @@ impl MemBasicWidget for Painter {
if app_state.should_get_widget_bounds() {
if let Some(widget) = app_state.widget_map.get_mut(&widget_id) {
widget.top_left_corner = Some((draw_loc.x, draw_loc.y));
- widget.bottom_right_corner =
- Some((draw_loc.x + draw_loc.width, draw_loc.y + draw_loc.height));
+ widget.bottom_right_corner = Some((
+ draw_loc.x + draw_loc.width - 1,
+ draw_loc.y + draw_loc.height - 1,
+ ));
}
}
}