[evolution/wip/webkit2] Bug 749712 - Undo/Redo in composer doesn't work right



commit 982c86597c0801c328958cdf39a6a846f615b510
Author: Tomas Popela <tpopela redhat com>
Date:   Thu Mar 3 13:35:23 2016 +0100

    Bug 749712 - Undo/Redo in composer doesn't work right

 .../e-html-editor-selection-dom-functions.c        |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/web-extensions/composer/e-html-editor-selection-dom-functions.c 
b/web-extensions/composer/e-html-editor-selection-dom-functions.c
index d395214..495a57b 100644
--- a/web-extensions/composer/e-html-editor-selection-dom-functions.c
+++ b/web-extensions/composer/e-html-editor-selection-dom-functions.c
@@ -6507,7 +6507,7 @@ dom_selection_get_coordinates (WebKitDOMDocument *document,
                if (created_selection_markers)
                        dom_selection_restore (document);
 
-               return;
+               goto workaroud;
        }
 
        element = webkit_dom_document_get_element_by_id (
@@ -6530,4 +6530,14 @@ dom_selection_get_coordinates (WebKitDOMDocument *document,
 
        if (created_selection_markers)
                dom_selection_restore (document);
+
+ 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;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]