[dia] Explicit extents update for text editing



commit 907d2afd3390cb3c4533a2a0db108186d718d551
Author: Hans Breuer <hans breuer org>
Date:   Tue Jun 14 12:44:45 2011 +0200

    Explicit extents update for text editing
    
    An empty text object does not contribute to the overall
    diagram extent for some while. Also there was only recalculation
    of the extent after movement of object or handle. As a result the
    overall diagram extent did not include text objects until they
    were moved.

 app/commands.c       |    1 +
 app/disp_callbacks.c |    3 ++-
 2 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/app/commands.c b/app/commands.c
index b5be0b0..55798e3 100644
--- a/app/commands.c
+++ b/app/commands.c
@@ -205,6 +205,7 @@ insert_text(DDisplay *ddisp, Focus *focus, const gchar *text)
 
   if (any_modified) {
     diagram_modified(ddisp->diagram);
+    diagram_update_extents(ddisp->diagram);
     undo_set_transactionpoint(ddisp->diagram->undo);
   }
 }
diff --git a/app/disp_callbacks.c b/app/disp_callbacks.c
index aca549d..a0317ad 100644
--- a/app/disp_callbacks.c
+++ b/app/disp_callbacks.c
@@ -433,7 +433,7 @@ handle_key_event(DDisplay *ddisp, Focus *focus,
   modified = (focus->key_event)(focus, keystate, keysym, str, strlen,
 				&obj_change);
 
-      /* Make sure object updates its data and its connected: */
+  /* Make sure object updates its data and its connected: */
   p = obj->position;
   (obj->ops->move)(obj,&p);  
   diagram_update_connections_object(ddisp->diagram,obj,TRUE);
@@ -445,6 +445,7 @@ handle_key_event(DDisplay *ddisp, Focus *focus,
       undo_object_change(ddisp->diagram, obj, obj_change);
       undo_set_transactionpoint(ddisp->diagram->undo);
     }
+    diagram_update_extents(ddisp->diagram);
     diagram_modified(ddisp->diagram);
   }
 



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