summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Popela <tpopela@redhat.com>2015-12-11 11:25:54 +0100
committerTomas Popela <tpopela@redhat.com>2015-12-11 11:30:25 +0100
commitbf36bef77ec998a89f3651d35057dc07742163b2 (patch)
treeefb72588ae5eb946551390deb274843625b91c4b
parent8416e625a2060b91991d37e6ab271deddd215010 (diff)
downloadevolution-bf36bef77ec998a89f3651d35057dc07742163b2.tar.gz
Bug 749712 - Undo/Redo in composer doesn't work right
Implement the workaround on the Evolution side. The cause of the bug is that WebKit is having problems determining the right line height for some fonts and font sizes (the right and wrong value differ by 1). To fix this we will add an extra one to the final top offset. This is safe to do even for fonts and font sizes that don't behave badly as we will still get the right element as we use fonts bigger than 1 pixel.
-rw-r--r--e-util/e-html-editor-selection.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/e-util/e-html-editor-selection.c b/e-util/e-html-editor-selection.c
index a64c939599..4a2914d283 100644
--- a/e-util/e-html-editor-selection.c
+++ b/e-util/e-html-editor-selection.c
@@ -1678,7 +1678,7 @@ e_html_editor_selection_get_selection_coordinates (EHTMLEditorSelection *selecti
if (created_selection_markers)
e_html_editor_selection_restore (selection);
- return;
+ goto workaroud;
}
element = webkit_dom_document_get_element_by_id (
@@ -1701,6 +1701,16 @@ e_html_editor_selection_get_selection_coordinates (EHTMLEditorSelection *selecti
if (created_selection_markers)
e_html_editor_selection_restore (selection);
+
+ workaroud:
+ /* Workaround for bug 749712 on the Evolution side. The cause of the bug
+ * is that WebKit is having problems determining the right line height
+ * for some fonts and font sizes (the right and wrong value differ by 1).
+ * To fix this we will add an extra one to the final top offset. This is
+ * safe to do even for fonts and font sizes that don't behave badly as we
+ * will still get the right element as we use fonts bigger than 1 pixel. */
+ *start_y += 1;
+ *end_y += 1;
}
/**