summaryrefslogtreecommitdiff
path: root/gui/sheet.c
diff options
context:
space:
mode:
Diffstat (limited to 'gui/sheet.c')
-rw-r--r--gui/sheet.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/gui/sheet.c b/gui/sheet.c
index 8b66bf9..6131163 100644
--- a/gui/sheet.c
+++ b/gui/sheet.c
@@ -419,17 +419,13 @@ static bool go_next_sheet(struct gui *gui)
static bool sheet_click(void *user, int x, int y)
{
struct gui *gui = user;
- const struct gui_sheet *curr_sheet = gui->curr_sheet;
+ const struct gui_sheet *curr_sheet = current_sheet(gui);
int ex, ey;
canvas_coord(gui, x, y, &ex, &ey);
ex += curr_sheet->xmin;
ey += curr_sheet->ymin;
- if (gui->old_hist && gui->diff_mode == diff_old)
- curr_sheet = find_corresponding_sheet(gui->old_hist->sheets,
- gui->new_hist->sheets, gui->curr_sheet);
-
if (aoi_click(&gui->aois, x, y))
return 1;
if (aoi_click(&curr_sheet->aois, ex, ey))
@@ -449,15 +445,11 @@ static bool sheet_click(void *user, int x, int y)
static bool sheet_hover_update(void *user, int x, int y)
{
struct gui *gui = user;
- const struct gui_sheet *curr_sheet = gui->curr_sheet;
+ const struct gui_sheet *curr_sheet = current_sheet(gui);
int ex, ey;
canvas_coord(gui, x, y, &ex, &ey);
- if (gui->old_hist && gui->diff_mode == diff_old)
- curr_sheet = find_corresponding_sheet(gui->old_hist->sheets,
- gui->new_hist->sheets, gui->curr_sheet);
-
if (aoi_hover(&gui->aois, x, y))
return 1;
return aoi_hover(&curr_sheet->aois,
@@ -468,7 +460,7 @@ static bool sheet_hover_update(void *user, int x, int y)
static bool sheet_drag_begin(void *user, int x, int y)
{
struct gui *gui = user;
- const struct gui_sheet *curr_sheet = gui->curr_sheet;
+ const struct gui_sheet *curr_sheet = current_sheet(gui);
int ex, ey;
struct record_bbox rec_bbox;
@@ -478,10 +470,6 @@ static bool sheet_drag_begin(void *user, int x, int y)
ex += curr_sheet->xmin;
ey += curr_sheet->ymin;
- if (gui->old_hist && gui->diff_mode == diff_old)
- curr_sheet = find_corresponding_sheet(gui->old_hist->sheets,
- gui->new_hist->sheets, gui->curr_sheet);
-
gui->drag_text = record_find_text_bbox(gfx_user(curr_sheet->gfx),
show_extra, ex, ey, &rec_bbox);
if (gui->drag_text) {