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
8e1cf395
Commit
8e1cf395
authored
Jun 17, 2012
by
Moritz Lipp
Browse files
Show correct page after leaving fullscreen mode
Fixes #220
parent
dd99eca7
Changes
4
Hide whitespace changes
Inline
Side-by-side
marks.c
View file @
8e1cf395
...
...
@@ -237,7 +237,7 @@ mark_evaluate(zathura_t* zathura, int key)
if
(
mark
!=
NULL
&&
mark
->
key
==
key
)
{
double
old_scale
=
zathura_document_get_scale
(
zathura
->
document
);
zathura_document_set_scale
(
zathura
->
document
,
mark
->
scale
);
readjust_view_after_zooming
(
zathura
,
old_scale
);
readjust_view_after_zooming
(
zathura
,
old_scale
,
true
);
render_all
(
zathura
);
position_set_delayed
(
zathura
,
mark
->
position_x
,
mark
->
position_y
);
...
...
shortcuts.c
View file @
8e1cf395
...
...
@@ -154,7 +154,7 @@ sc_adjust_window(girara_session_t* session, girara_argument_t* argument,
}
/* keep position */
readjust_view_after_zooming
(
zathura
,
old_zoom
);
readjust_view_after_zooming
(
zathura
,
old_zoom
,
false
);
/* re-render all pages */
render_all
(
zathura
);
...
...
@@ -1007,7 +1007,7 @@ sc_zoom(girara_session_t* session, girara_argument_t* argument, girara_event_t*
}
/* keep position */
readjust_view_after_zooming
(
zathura
,
old_zoom
);
readjust_view_after_zooming
(
zathura
,
old_zoom
,
true
);
render_all
(
zathura
);
...
...
utils.c
View file @
8e1cf395
...
...
@@ -312,7 +312,7 @@ zathura_page_get_widget(zathura_t* zathura, zathura_page_t* page)
}
void
readjust_view_after_zooming
(
zathura_t
*
zathura
,
float
old_zoom
)
{
readjust_view_after_zooming
(
zathura_t
*
zathura
,
float
old_zoom
,
bool
delay
)
{
if
(
zathura
==
NULL
||
zathura
->
document
==
NULL
)
{
return
;
}
...
...
@@ -325,7 +325,12 @@ readjust_view_after_zooming(zathura_t *zathura, float old_zoom) {
gdouble
valx
=
gtk_adjustment_get_value
(
hadjustment
)
/
old_zoom
*
scale
;
gdouble
valy
=
gtk_adjustment_get_value
(
vadjustment
)
/
old_zoom
*
scale
;
position_set_delayed
(
zathura
,
valx
,
valy
);
if
(
delay
==
true
)
{
position_set_delayed
(
zathura
,
valx
,
valy
);
}
else
{
set_adjustment
(
vadjustment
,
valx
);
set_adjustment
(
vadjustment
,
valy
);
}
}
void
...
...
utils.h
View file @
8e1cf395
...
...
@@ -119,8 +119,9 @@ GtkWidget* zathura_page_get_widget(zathura_t* zathura, zathura_page_t* page);
*
* @param zathura Zathura instance
* @param old_zoom Old zoom value
* @param delay true if action should be delayed
*/
void
readjust_view_after_zooming
(
zathura_t
*
zathura
,
float
old_zoom
);
void
readjust_view_after_zooming
(
zathura_t
*
zathura
,
float
old_zoom
,
bool
delay
);
/**
* Set if the search results should be drawn or not
...
...
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