dia r4367 - in trunk: . lib plug-ins/cairo



Author: hans
Date: Sun Apr  5 16:38:38 2009
New Revision: 4367
URL: http://svn.gnome.org/viewvc/dia?rev=4367&view=rev

Log:
2009-04-04  Hans Breuer  <hans breuer org>

	* lib/diarenderer.c(get_text_width) : complain if the derived renderer
	does not implment the method and does not maintian DiaRenderer::font.
	* plug-ins/cairo/diacairo-renderer.c : actually maintain the font field
	to make text cursor position calculation work, part of bug #576548



Modified:
   trunk/ChangeLog
   trunk/lib/diarenderer.c
   trunk/plug-ins/cairo/diacairo-renderer.c

Modified: trunk/lib/diarenderer.c
==============================================================================
--- trunk/lib/diarenderer.c	(original)
+++ trunk/lib/diarenderer.c	Sun Apr  5 16:38:38 2009
@@ -1430,6 +1430,9 @@
                                  renderer->font,
                                  renderer->font_height);
     g_free (str);
+  } else {
+    g_warning ("%s::get_text_width not implemented (and renderer->font==NULL)!", 
+               G_OBJECT_CLASS_NAME (G_OBJECT_GET_CLASS (renderer)));
   }
 
   return ret;

Modified: trunk/plug-ins/cairo/diacairo-renderer.c
==============================================================================
--- trunk/plug-ins/cairo/diacairo-renderer.c	(original)
+++ trunk/plug-ins/cairo/diacairo-renderer.c	Sun Apr  5 16:38:38 2009
@@ -335,6 +335,15 @@
 #endif
 
   DIAG_STATE(renderer->cr)
+  
+  /* for the interactive case we must maintain the font field in the base class */
+  if (self->is_interactive) {
+    dia_font_ref(font);
+    if (self->font)
+      dia_font_unref(self->font);
+    self->font = font;
+    self->font_height = height;
+  }
 }
 
 static void



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