[evolution-patches] [gtkhtml] zooming fix




Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/ChangeLog,v
retrieving revision 1.2106
diff -u -p -r1.2106 ChangeLog
--- ChangeLog	14 Mar 2005 18:36:14 -0000	1.2106
+++ ChangeLog	15 Mar 2005 14:49:52 -0000
@@ -1,3 +1,8 @@
+2005-03-15  Radek Doulik  <rodo novell com>
+
+	* htmltext.c (prepare_attrs): add size attributes in case
+	magnification != 1.0
+
 2005-03-14  Radek Doulik  <rodo novell com>
 
 	* test-suite.c (test_cursor_around_image): added new test for
Index: htmltext.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/htmltext.c,v
retrieving revision 1.277
diff -u -p -r1.277 htmltext.c
--- htmltext.c	9 Mar 2005 16:15:57 -0000	1.277
+++ htmltext.c	15 Mar 2005 14:50:02 -0000
@@ -26,6 +26,7 @@
 #include <string.h>
 #include <sys/types.h>
 #include <regex.h>
+#include <math.h>
 
 #include <pango/pango.h>
 
@@ -1196,14 +1197,21 @@ prepare_attrs (HTMLText *text, HTMLPaint
 		attr->start_index = 0;
 		attr->end_index = text->text_bytes;
 		pango_attr_list_insert (attrs, attr);
-		if (painter->font_manager.fix_size != painter->font_manager.var_size) {
-			attr = pango_attr_size_new (painter->font_manager.fix_size);
+		if (painter->font_manager.fix_size != painter->font_manager.var_size || fabs (painter->font_manager.magnification - 1.0) > 0.001) {
+			attr = pango_attr_size_new (painter->font_manager.fix_size*painter->font_manager.magnification);
+			attr->start_index = 0;
+			attr->end_index = text->text_bytes;
+			pango_attr_list_insert (attrs, attr);
+		}
+	} else {
+		if (fabs (painter->font_manager.magnification - 1.0) > 0.001) {
+			attr = pango_attr_size_new (painter->font_manager.var_size*painter->font_manager.magnification);
 			attr->start_index = 0;
 			attr->end_index = text->text_bytes;
 			pango_attr_list_insert (attrs, attr);
 		}
-	} else
 		pango_attr_list_splice (attrs, text->attr_list, 0, 0);
+	}
 
 	if (text->extra_attr_list)
 		pango_attr_list_splice (attrs, text->extra_attr_list, 0, 0);


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