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
Marius
zathura
Commits
aaa54673
Commit
aaa54673
authored
Jun 23, 2014
by
Sebastian Ramacher
Browse files
Document nrow computation
Signed-off-by:
Sebastian Ramacher
<
sebastian+dev@ramacher.at
>
parent
d07dfe48
Changes
1
Hide whitespace changes
Inline
Side-by-side
adjustment.c
View file @
aaa54673
...
...
@@ -63,9 +63,17 @@ position_to_page_number(zathura_document_t* document, double pos_x,
unsigned
int
c0
=
zathura_document_get_first_page_column
(
document
);
unsigned
int
npag
=
zathura_document_get_number_of_pages
(
document
);
unsigned
int
ncol
=
zathura_document_get_pages_per_row
(
document
);
unsigned
int
nrow
=
(
npag
+
c0
-
1
+
ncol
-
1
)
/
ncol
;
/* number of rows */
unsigned
int
nrow
=
0
;
unsigned
int
pad
=
zathura_document_get_page_padding
(
document
);
if
(
c0
==
1
)
{
/* There is no offset, so this is easy. */
nrow
=
(
npag
+
ncol
-
1
)
/
ncol
;
}
else
{
/* If there is a offset, we handle the first row extra. */
nrow
=
1
+
(
npag
-
(
ncol
-
c0
-
1
)
+
(
ncol
-
1
))
/
ncol
;
}
unsigned
int
col
=
floor
(
pos_x
*
(
double
)
doc_width
/
(
double
)(
cell_width
+
pad
));
unsigned
int
row
=
floor
(
pos_y
*
(
double
)
doc_height
/
(
double
)(
cell_height
+
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