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
42c1780a
Commit
42c1780a
authored
Oct 26, 2014
by
Sebastian Ramacher
Browse files
CS
Signed-off-by:
Sebastian Ramacher
<
sebastian+dev@ramacher.at
>
parent
70482cc0
Changes
2
Hide whitespace changes
Inline
Side-by-side
page-widget.c
View file @
42c1780a
...
...
@@ -594,14 +594,16 @@ surface_small_enough(cairo_surface_t* surface, cairo_surface_t* old)
const
unsigned
int
width
=
cairo_image_surface_get_width
(
surface
);
const
unsigned
int
height
=
cairo_image_surface_get_height
(
surface
);
if
(
width
*
height
>
THUMBNAIL_MAX_SIZE
)
if
(
width
*
height
>
THUMBNAIL_MAX_SIZE
)
{
return
false
;
}
if
(
old
!=
NULL
)
{
const
unsigned
int
width_old
=
cairo_image_surface_get_width
(
old
);
const
unsigned
int
height_old
=
cairo_image_surface_get_height
(
old
);
if
(
width
*
height
<
width_old
*
height_old
)
if
(
width
*
height
<
width_old
*
height_old
)
{
return
false
;
}
}
return
true
;
...
...
@@ -613,8 +615,9 @@ draw_thumbnail_image(cairo_surface_t* surface)
unsigned
int
width
=
cairo_image_surface_get_width
(
surface
);
unsigned
int
height
=
cairo_image_surface_get_height
(
surface
);
double
scale
=
sqrt
((
double
)
THUMBNAIL_INITIAL_SIZE
/
(
width
*
height
));
if
(
scale
>
THUMBNAIL_MAX_SCALE
)
if
(
scale
>
THUMBNAIL_MAX_SCALE
)
{
scale
=
THUMBNAIL_MAX_SCALE
;
}
width
=
width
*
scale
;
height
=
height
*
scale
;
...
...
@@ -647,8 +650,9 @@ zathura_page_widget_update_surface(ZathuraPage* widget, cairo_surface_t* surface
cairo_surface_reference
(
surface
);
if
(
surface_small_enough
(
surface
,
priv
->
thumbnail
))
{
if
(
priv
->
thumbnail
!=
NULL
)
if
(
priv
->
thumbnail
!=
NULL
)
{
cairo_surface_destroy
(
priv
->
thumbnail
);
}
priv
->
thumbnail
=
surface
;
cairo_surface_reference
(
surface
);
}
else
if
(
new_render
)
{
...
...
shortcuts.c
View file @
42c1780a
...
...
@@ -1406,8 +1406,9 @@ 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
)
if
(
fabs
(
new_zoom
-
old_zoom
)
<=
DBL_EPSILON
)
{
return
false
;
}
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