From fdd2d1b7479a908b68f864f71271accdf4b6fd56 Mon Sep 17 00:00:00 2001 From: ClementTsang Date: Sat, 26 Sep 2020 21:49:28 -0400 Subject: [PATCH] bug: fix basic mode arrows being slightly larger than intended --- src/canvas/widgets/basic_table_arrows.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/canvas/widgets/basic_table_arrows.rs b/src/canvas/widgets/basic_table_arrows.rs index bce169e1..d7f79dc6 100644 --- a/src/canvas/widgets/basic_table_arrows.rs +++ b/src/canvas/widgets/basic_table_arrows.rs @@ -139,16 +139,19 @@ 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)); + basic_table.left_tlc = + Some((margined_draw_loc[0].x, 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 + margined_draw_loc[0].height, + margined_draw_loc[0].y + 1 + margined_draw_loc[0].height, )); - basic_table.right_tlc = Some((margined_draw_loc[2].x, margined_draw_loc[2].y)); + basic_table.right_tlc = + Some((margined_draw_loc[2].x, 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 + margined_draw_loc[2].height, + margined_draw_loc[2].y + 1 + margined_draw_loc[2].height, )); } }