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/basic_table_arrows.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/basic_table_arrows.rs')
-rw-r--r-- | src/canvas/widgets/basic_table_arrows.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/canvas/widgets/basic_table_arrows.rs b/src/canvas/widgets/basic_table_arrows.rs index f9d937d4..e7f769a8 100644 --- a/src/canvas/widgets/basic_table_arrows.rs +++ b/src/canvas/widgets/basic_table_arrows.rs @@ -136,19 +136,18 @@ impl BasicTableArrows for Painter { ); if app_state.should_get_widget_bounds() { - // The y is +1 as for some reason the height is 2... but we only want a height of 1. if let Some(basic_table) = &mut app_state.basic_table_widget_state { basic_table.left_tlc = - Some((margined_draw_loc[0].x, margined_draw_loc[0].y + 1)); + Some((margined_draw_loc[0].x - 1, margined_draw_loc[0].y + 1)); basic_table.left_brc = Some(( - margined_draw_loc[0].x + margined_draw_loc[0].width, - margined_draw_loc[0].y + 1 + margined_draw_loc[0].height, + margined_draw_loc[0].x + margined_draw_loc[0].width - 1, + margined_draw_loc[0].y + 1, )); basic_table.right_tlc = - Some((margined_draw_loc[2].x, margined_draw_loc[2].y + 1)); + Some((margined_draw_loc[2].x - 1, margined_draw_loc[2].y + 1)); basic_table.right_brc = Some(( - margined_draw_loc[2].x + margined_draw_loc[2].width, - margined_draw_loc[2].y + 1 + margined_draw_loc[2].height, + margined_draw_loc[2].x + margined_draw_loc[2].width - 1, + margined_draw_loc[2].y + 1, )); } } |