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
dfbd39c5
Commit
dfbd39c5
authored
Jun 06, 2012
by
Moritz Lipp
Browse files
Evalute ZATHURA_LINK_DESTINATION_XYZ
parent
7d2265c2
Changes
1
Hide whitespace changes
Inline
Side-by-side
links.c
View file @
dfbd39c5
...
...
@@ -8,6 +8,7 @@
#include "links.h"
#include "zathura.h"
#include "document.h"
#include "utils.h"
struct
zathura_link_s
{
...
...
@@ -122,12 +123,32 @@ zathura_link_evaluate(zathura_t* zathura, zathura_link_t* link)
switch
(
link
->
type
)
{
case
ZATHURA_LINK_GOTO_DEST
:
switch
(
link
->
target
.
destination_type
)
{
case
ZATHURA_LINK_DESTINATION_XYZ
:
if
(
link
->
target
.
scale
=
=
0
)
{
case
ZATHURA_LINK_DESTINATION_XYZ
:
{
if
(
link
->
target
.
scale
!
=
0
)
{
zathura_document_set_scale
(
zathura
->
document
,
link
->
target
.
scale
);
}
page_set_delayed
(
zathura
,
link
->
target
.
page_number
);
/* get page */
zathura_page_t
*
page
=
zathura_document_get_page
(
zathura
->
document
,
link
->
target
.
page_number
);
if
(
page
==
NULL
)
{
return
;
}
/* get page offset */
page_offset_t
offset
;
page_calculate_offset
(
zathura
,
page
,
&
offset
);
if
(
link
->
target
.
left
!=
-
1
)
{
offset
.
x
+=
link
->
target
.
left
*
zathura_document_get_scale
(
zathura
->
document
);
}
if
(
link
->
target
.
top
!=
-
1
)
{
offset
.
y
+=
link
->
target
.
top
*
zathura_document_get_scale
(
zathura
->
document
);
}
position_set_delayed
(
zathura
,
offset
.
x
,
offset
.
y
);
}
break
;
default:
break
;
...
...
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