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
403d867c
Commit
403d867c
authored
Nov 05, 2013
by
Sebastian Ramacher
Browse files
Some CS
Signed-off-by:
Sebastian Ramacher
<
sebastian+dev@ramacher.at
>
parent
08d799a1
Changes
2
Hide whitespace changes
Inline
Side-by-side
adjustment.c
View file @
403d867c
...
...
@@ -11,20 +11,18 @@ page_calc_height_width(zathura_document_t* document, double height, double width
{
g_return_val_if_fail
(
document
!=
NULL
&&
page_height
!=
NULL
&&
page_width
!=
NULL
,
0
.
0
);
double
scale
=
zathura_document_get_scale
(
document
);
double
real_scale
;
double
scale
=
zathura_document_get_scale
(
document
);
if
(
rotate
&&
zathura_document_get_rotation
(
document
)
%
180
)
{
*
page_width
=
round
(
height
*
scale
);
*
page_height
=
round
(
width
*
scale
);
real_
scale
=
MAX
(
*
page_width
/
height
,
*
page_height
/
width
);
scale
=
MAX
(
*
page_width
/
height
,
*
page_height
/
width
);
}
else
{
*
page_width
=
round
(
width
*
scale
);
*
page_height
=
round
(
height
*
scale
);
real_
scale
=
MAX
(
*
page_width
/
width
,
*
page_height
/
height
);
scale
=
MAX
(
*
page_width
/
width
,
*
page_height
/
height
);
}
return
real_
scale
;
return
scale
;
}
void
...
...
document.c
View file @
403d867c
...
...
@@ -173,11 +173,11 @@ zathura_document_open(zathura_plugin_manager_t* plugin_manager, const char*
document
->
pages
[
page_id
]
=
page
;
/* cell_width and cell_height is the maximum of all the pages width and height */
double
width
=
zathura_page_get_width
(
page
);
const
double
width
=
zathura_page_get_width
(
page
);
if
(
document
->
cell_width
<
width
)
document
->
cell_width
=
width
;
double
height
=
zathura_page_get_height
(
page
);
const
double
height
=
zathura_page_get_height
(
page
);
if
(
document
->
cell_height
<
height
)
document
->
cell_height
=
height
;
}
...
...
@@ -500,7 +500,6 @@ zathura_document_get_cell_size(zathura_document_t* document,
page_calc_height_width
(
document
,
document
->
cell_height
,
document
->
cell_width
,
height
,
width
,
true
);
}
void
...
...
@@ -509,14 +508,14 @@ zathura_document_get_document_size(zathura_document_t* document,
{
g_return_if_fail
(
document
!=
NULL
&&
height
!=
NULL
&&
width
!=
NULL
);
unsigned
int
npag
=
zathura_document_get_number_of_pages
(
document
);
unsigned
int
ncol
=
zathura_document_get_pages_per_row
(
document
);
unsigned
int
c0
=
zathura_document_get_first_page_column
(
document
);
unsigned
int
nrow
=
(
npag
+
c0
-
1
+
ncol
-
1
)
/
ncol
;
/* number of rows */
unsigned
int
pad
=
zathura_document_get_page_padding
(
document
);
unsigned
int
cell_height
=
0
,
cell_width
=
0
;
unsigned
int
cell_height
=
0
;
unsigned
int
cell_width
=
0
;
zathura_document_get_cell_size
(
document
,
&
cell_height
,
&
cell_width
);
*
width
=
ncol
*
cell_width
+
(
ncol
-
1
)
*
pad
;
...
...
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