mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-28 06:06:00 +01:00
Use event.x and event.y
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
7a997ef88f
commit
fdff7076b7
1 changed files with 5 additions and 6 deletions
11
shortcuts.c
11
shortcuts.c
|
@ -492,7 +492,7 @@ sc_rotate(girara_session_t* session, girara_argument_t* argument,
|
|||
|
||||
bool
|
||||
sc_scroll(girara_session_t* session, girara_argument_t* argument,
|
||||
girara_event_t* UNUSED(event), unsigned int t)
|
||||
girara_event_t* event, unsigned int t)
|
||||
{
|
||||
g_return_val_if_fail(session != NULL, false);
|
||||
g_return_val_if_fail(session->global.data != NULL, false);
|
||||
|
@ -599,9 +599,8 @@ sc_scroll(girara_session_t* session, girara_argument_t* argument,
|
|||
break;
|
||||
|
||||
case BIDIRECTIONAL: {
|
||||
double* movement = (double*)argument->data;
|
||||
pos_x += movement[0] * t * scroll_hstep / (double)doc_width;
|
||||
pos_y += movement[1] * t * scroll_step / (double)doc_height;
|
||||
pos_x += event.x * t * scroll_hstep / (double)doc_width;
|
||||
pos_y += event.y * t * scroll_step / (double)doc_height;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1353,7 +1352,7 @@ sc_quit(girara_session_t* session, girara_argument_t* UNUSED(argument),
|
|||
|
||||
bool
|
||||
sc_zoom(girara_session_t* session, girara_argument_t* argument, girara_event_t*
|
||||
UNUSED(event), unsigned int t)
|
||||
event, unsigned int t)
|
||||
{
|
||||
g_return_val_if_fail(session != NULL, false);
|
||||
g_return_val_if_fail(session->global.data != NULL, false);
|
||||
|
@ -1383,7 +1382,7 @@ sc_zoom(girara_session_t* session, girara_argument_t* argument, girara_event_t*
|
|||
zathura_document_set_scale(zathura->document, t / 100.0);
|
||||
}
|
||||
} else if (argument->n == ZOOM_SMOOTH) {
|
||||
double dy = ((double*)argument->data)[1];
|
||||
const double dy = event.y;
|
||||
zathura_document_set_scale(zathura->document, old_zoom + zoom_step * dy);
|
||||
} else {
|
||||
zathura_document_set_scale(zathura->document, 1.0);
|
||||
|
|
Loading…
Reference in a new issue