Commit fdff7076 authored by Sebastian Ramacher's avatar Sebastian Ramacher
Browse files

Use event.x and event.y


Signed-off-by: Sebastian Ramacher's avatarSebastian Ramacher <sebastian+dev@ramacher.at>
parent 7a997ef8
......@@ -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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment