diff options
author | Clement Tsang <34804052+ClementTsang@users.noreply.github.com> | 2021-04-23 23:13:42 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-23 23:13:42 -0400 |
commit | d4a18aea759818989acd18295618063155e6a2b9 (patch) | |
tree | 0d785a3774c813d0fb2086dc8ed5c0d3aa16fd9e /src/canvas/widgets/cpu_basic.rs | |
parent | fcc478a1eb978c826ac416399813df7cdc6b94b2 (diff) |
bug: Fix mouse hitboxes (#459)
Fixes the mouse hitbox checks overextending by 1. Also reverts the bandaid fix done for #458.
Diffstat (limited to 'src/canvas/widgets/cpu_basic.rs')
-rw-r--r-- | src/canvas/widgets/cpu_basic.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/canvas/widgets/cpu_basic.rs b/src/canvas/widgets/cpu_basic.rs index e88bbf03..5beb3f73 100644 --- a/src/canvas/widgets/cpu_basic.rs +++ b/src/canvas/widgets/cpu_basic.rs @@ -198,10 +198,8 @@ 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 - 1, - draw_loc.y + draw_loc.height - 1, - )); + widget.bottom_right_corner = + Some((draw_loc.x + draw_loc.width, draw_loc.y + draw_loc.height)); } } } |