[dia/dia-0-97] Explicit extents update for text editing



commit 9e6ef51ac4b10d3bcc805b2f2bf642008a1f776f
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.
    (cherry picked from commit 907d2afd3390cb3c4533a2a0db108186d718d551)

 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 8686900..47d597b 100644
--- a/app/commands.c
+++ b/app/commands.c
@@ -206,6 +206,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 e517677..c42a43c 100644
--- a/app/disp_callbacks.c
+++ b/app/disp_callbacks.c
@@ -389,7 +389,7 @@ handle_key_event(DDisplay *ddisp, Focus *focus, guint keysym,
   modified = (focus->key_event)(focus, 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);
@@ -401,6 +401,7 @@ handle_key_event(DDisplay *ddisp, Focus *focus, guint keysym,
       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]