mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2025-01-01 04:56:00 +01:00
Simplify
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
4341a09473
commit
6aa5420f37
1 changed files with 5 additions and 8 deletions
|
@ -862,21 +862,18 @@ cb_zathura_page_widget_button_release_event(GtkWidget* widget, GdkEventButton* b
|
||||||
|
|
||||||
zathura_rectangle_t tmp = priv->mouse.selection;
|
zathura_rectangle_t tmp = priv->mouse.selection;
|
||||||
|
|
||||||
double scale = zathura_document_get_scale(document);
|
const double scale = zathura_document_get_scale(document);
|
||||||
tmp.x1 /= scale;
|
tmp.x1 /= scale;
|
||||||
tmp.x2 /= scale;
|
tmp.x2 /= scale;
|
||||||
tmp.y1 /= scale;
|
tmp.y1 /= scale;
|
||||||
tmp.y2 /= scale;
|
tmp.y2 /= scale;
|
||||||
|
|
||||||
char* text = zathura_page_get_text(priv->page, tmp, NULL);
|
char* text = zathura_page_get_text(priv->page, tmp, NULL);
|
||||||
if (text != NULL) {
|
if (text != NULL && *text != '\0') {
|
||||||
if (strlen(text) > 0) {
|
/* emit text-selected signal */
|
||||||
/* emit text-selected signal */
|
g_signal_emit(ZATHURA_PAGE(widget), signals[TEXT_SELECTED], 0, text);
|
||||||
g_signal_emit(ZATHURA_PAGE(widget), signals[TEXT_SELECTED], 0, text);
|
|
||||||
}
|
|
||||||
|
|
||||||
g_free(text);
|
|
||||||
}
|
}
|
||||||
|
g_free(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
priv->mouse.selection_basepoint.x = -1;
|
priv->mouse.selection_basepoint.x = -1;
|
||||||
|
|
Loading…
Reference in a new issue