diff options
author | Clement Tsang <34804052+ClementTsang@users.noreply.github.com> | 2021-04-23 19:31:35 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-23 19:31:35 -0400 |
commit | fcc478a1eb978c826ac416399813df7cdc6b94b2 (patch) | |
tree | 438c738f559036d536bed031945a7d30cf340233 /src/canvas/widgets/cpu_basic.rs | |
parent | 280bcbead2e0bdb8ae94d0ab5b8232f7c4fbec31 (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/cpu_basic.rs')
-rw-r--r-- | src/canvas/widgets/cpu_basic.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/canvas/widgets/cpu_basic.rs b/src/canvas/widgets/cpu_basic.rs index 5beb3f73..e88bbf03 100644 --- a/src/canvas/widgets/cpu_basic.rs +++ b/src/canvas/widgets/cpu_basic.rs @@ -198,8 +198,10 @@ impl CpuBasicWidget for Painter { // Update draw loc in widget map 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, + )); } } } |