Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
pwmt
zathura
Commits
9b5dceac
Commit
9b5dceac
authored
Nov 06, 2016
by
Sebastian Ramacher
Browse files
Debug output for sc_zoom
Signed-off-by:
Sebastian Ramacher
<
sebastian+dev@ramacher.at
>
parent
bcdc7aba
Changes
1
Hide whitespace changes
Inline
Side-by-side
zathura/shortcuts.c
View file @
9b5dceac
...
...
@@ -1375,19 +1375,25 @@ sc_zoom(girara_session_t* session, girara_argument_t* argument, girara_event_t*
/* specify new zoom value */
if
(
argument
->
n
==
ZOOM_IN
)
{
girara_debug
(
"Increasing zoom by %f."
,
zoom_step
-
1
.
0
);
zathura_document_set_scale
(
zathura
->
document
,
old_zoom
*
zoom_step
);
}
else
if
(
argument
->
n
==
ZOOM_OUT
)
{
girara_debug
(
"Decreasing zoom by %f."
,
zoom_step
-
1
.
0
);
zathura_document_set_scale
(
zathura
->
document
,
old_zoom
/
zoom_step
);
}
else
if
(
argument
->
n
==
ZOOM_SPECIFIC
)
{
if
(
t
==
0
)
{
girara_debug
(
"Setting zoom to 1."
);
zathura_document_set_scale
(
zathura
->
document
,
1
.
0
);
}
else
{
girara_debug
(
"Setting zoom to %f."
,
t
/
100
.
0
);
zathura_document_set_scale
(
zathura
->
document
,
t
/
100
.
0
);
}
}
else
if
(
argument
->
n
==
ZOOM_SMOOTH
)
{
const
double
dy
=
(
event
!=
NULL
)
?
event
->
y
:
1
.
0
;
zathura_document_set_scale
(
zathura
->
document
,
old_zoom
+
zoom_step
*
dy
);
const
double
dy
=
(
event
!=
NULL
)
?
event
->
y
:
1
.
0
;
girara_debug
(
"Increasing zoom by %f."
,
zoom_step
*
dy
-
1
.
0
);
zathura_document_set_scale
(
zathura
->
document
,
old_zoom
+
zoom_step
*
dy
);
}
else
{
girara_debug
(
"Setting zoom to 1."
);
zathura_document_set_scale
(
zathura
->
document
,
1
.
0
);
}
...
...
@@ -1397,9 +1403,11 @@ sc_zoom(girara_session_t* session, girara_argument_t* argument, girara_event_t*
const
double
new_zoom
=
zathura_document_get_scale
(
zathura
->
document
);
if
(
fabs
(
new_zoom
-
old_zoom
)
<=
DBL_EPSILON
)
{
girara_debug
(
"New and old zoom level are too close: %f vs. %f, diff = %f"
,
new_zoom
,
old_zoom
,
fabs
(
new_zoom
-
old_zoom
));
return
false
;
}
girara_debug
(
"Re-rendering with new zoom level %f."
,
new_zoom
);
render_all
(
zathura
);
refresh_view
(
zathura
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment