[gtkhtml] Frame/iframe print miscalculates its height



commit 978fb7b16cd068fc13dc7ffeede8edf43e710414
Author: Milan Crha <mcrha redhat com>
Date:   Tue Jan 3 12:28:41 2017 +0100

    Frame/iframe print miscalculates its height
    
    When printing a document with a frame or iframe, the content below
    the frame could cover part of the bottom of the frame, due to it
    miscalculating its height for the print. The code didn't add frame's
    top and bottom border to the content height.

 gtkhtml/htmlframe.c  |    4 ++++
 gtkhtml/htmliframe.c |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/gtkhtml/htmlframe.c b/gtkhtml/htmlframe.c
index b243db3..d4564cd 100644
--- a/gtkhtml/htmlframe.c
+++ b/gtkhtml/htmlframe.c
@@ -261,6 +261,10 @@ html_frame_real_calc_size (HTMLObject *o,
                o->width = e->width;
                o->ascent = e->height;
                o->descent = 0;
+
+               if (G_OBJECT_TYPE (painter) == HTML_TYPE_PRINTER) {
+                       o->ascent += html_painter_get_pixel_size (painter) * (html_engine_get_top_border (e) 
+ html_engine_get_bottom_border (e));
+               }
        } else
                return (* HTML_OBJECT_CLASS (parent_class)->calc_size) (o, painter, changed_objs);
 
diff --git a/gtkhtml/htmliframe.c b/gtkhtml/htmliframe.c
index 3ed8aa2..d6f6044 100644
--- a/gtkhtml/htmliframe.c
+++ b/gtkhtml/htmliframe.c
@@ -383,6 +383,10 @@ html_iframe_real_calc_size (HTMLObject *o,
                o->width = e->width;
                o->ascent = e->height;
                o->descent = 0;
+
+               if (G_OBJECT_TYPE (painter) == HTML_TYPE_PRINTER) {
+                       o->ascent += html_painter_get_pixel_size (painter) * (html_engine_get_top_border (e) 
+ html_engine_get_bottom_border (e));
+               }
        } else
                return (* HTML_OBJECT_CLASS (parent_class)->calc_size) (o, painter, changed_objs);
 


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