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
7f4acdb0
Commit
7f4acdb0
authored
Jan 23, 2018
by
Jeremie Knuesel
Browse files
HiDPI: fix thumbnail scaling
parent
36d9ece9
Changes
1
Hide whitespace changes
Inline
Side-by-side
zathura/page-widget.c
View file @
7f4acdb0
...
...
@@ -445,8 +445,18 @@ zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo)
}
else
{
const
unsigned
int
height
=
cairo_image_surface_get_height
(
priv
->
thumbnail
);
const
unsigned
int
width
=
cairo_image_surface_get_width
(
priv
->
thumbnail
);
const
unsigned
int
pheight
=
(
rotation
%
180
?
page_width
:
page_height
);
const
unsigned
int
pwidth
=
(
rotation
%
180
?
page_height
:
page_width
);
unsigned
int
pheight
=
(
rotation
%
180
?
page_width
:
page_height
);
unsigned
int
pwidth
=
(
rotation
%
180
?
page_height
:
page_width
);
#ifdef HAVE_HIDPI_SUPPORT
double
device_scale_x
;
double
device_scale_y
;
cairo_surface_get_device_scale
(
priv
->
thumbnail
,
&
device_scale_x
,
&
device_scale_y
);
if
(
device_scale_x
!=
0
.
0
&&
device_scale_y
!=
0
.
0
)
{
pwidth
*=
device_scale_x
;
pheight
*=
device_scale_y
;
}
#endif
cairo_scale
(
cairo
,
pwidth
/
(
double
)
width
,
pheight
/
(
double
)
height
);
cairo_set_source_surface
(
cairo
,
priv
->
thumbnail
,
0
,
0
);
...
...
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