mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2025-01-31 00:44:57 +01:00
Calculate correct annotation position
This commit is contained in:
parent
d1220ea01e
commit
33ec398a0e
1 changed files with 8 additions and 4 deletions
|
@ -777,11 +777,15 @@ cb_menu_annotation_add(GtkMenuItem* item, ZathuraPage* page)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* calculate position */
|
||||||
|
zathura_document_t* document = zathura_page_get_document(priv->page);
|
||||||
|
double scale = zathura_document_get_scale(document);
|
||||||
|
|
||||||
zathura_rectangle_t position = {
|
zathura_rectangle_t position = {
|
||||||
priv->events.mouse_click.x,
|
priv->events.mouse_click.x / scale,
|
||||||
priv->events.mouse_click.y,
|
priv->events.mouse_click.y / scale,
|
||||||
priv->events.mouse_click.x,
|
priv->events.mouse_click.x / scale,
|
||||||
priv->events.mouse_click.y
|
priv->events.mouse_click.y / scale
|
||||||
};
|
};
|
||||||
|
|
||||||
zathura_annotation_set_position(annotation, position);
|
zathura_annotation_set_position(annotation, position);
|
||||||
|
|
Loading…
Reference in a new issue