http://code.google.com/p/labyrinth/source/detail?r=366
Modified:
/trunk/ChangeLog
/trunk/src/BaseThought.py
/trunk/src/ImageThought.py
/trunk/src/MMapArea.py
/trunk/src/TextThought.py
=======================================
--- /trunk/ChangeLog Sun Apr 24 06:21:28 2011
+++ /trunk/ChangeLog Sun Apr 24 07:36:41 2011
@@ -1,3 +1,14 @@
+2011-04-24 Matthias Vogelgesang <matthias.v...@gmail.com>
+ * src/BaseThought.py
+ * src/MMapArea.py
+ * src/ImageThought.py
+ * src/TextThought.py:
+ Fix performance regression
+
+2011-04-24 Matthias Vogelgesang <matthias.v...@gmail.com>
+ * src/MMapArea.py:
+ Fix double-clicking on thought
+
2011-04-24 Matthias Vogelgesang <matthias.v...@gmail.com>
* src/Links.py
* src/MMapArea.py:
=======================================
--- /trunk/src/BaseThought.py Sat Apr 23 07:28:34 2011
+++ /trunk/src/BaseThought.py Sun Apr 24 07:36:41 2011
@@ -138,7 +138,7 @@
def move_by (self, x, y):
self.ul = (self.ul[0]+x, self.ul[1]+y)
- self.recalc_edges ()
+ self.recalc_position ()
self.emit ("update_links")
self.emit ("update_view")
@@ -230,6 +230,9 @@
def recalc_edges (self):
pass
+ def recalc_position (self):
+ pass
+
def delete_surroundings(self, imcontext, offset, n_chars, mode):
pass
=======================================
--- /trunk/src/ImageThought.py Sat Apr 23 07:28:34 2011
+++ /trunk/src/ImageThought.py Sun Apr 24 07:36:41 2011
@@ -129,6 +129,9 @@
self.pic_location = (self.ul[0]+margin[0], self.ul[1]+margin[1])
self.lr = (self.pic_location[0]+self.width+margin[2],
self.pic_location[1]+self.height+margin[3])
+ def recalc_position (self):
+ self.recalc_edges ()
+
def undo_resize (self, action, mode):
self.undo.block ()
if mode == UndoManager.UNDO:
=======================================
--- /trunk/src/MMapArea.py Sun Apr 24 06:51:27 2011
+++ /trunk/src/MMapArea.py Sun Apr 24 07:36:41 2011
@@ -228,9 +228,6 @@
self.is_bbox_selecting = True
elif event.button == 3:
ret = self.create_popup_menu (None, event, MENU_EMPTY_SPACE)
-
- if ret == False and self.editing:
- self.finish_editing()
return ret
def undo_move (self, action, mode):
=======================================
--- /trunk/src/TextThought.py Sat Apr 23 08:41:14 2011
+++ /trunk/src/TextThought.py Sun Apr 24 07:36:41 2011
@@ -197,11 +197,9 @@
return show_text
def recalc_edges (self):
- if (not hasattr(self, "layout")):
- return
del self.layout
- show_text = self.attrs_changed ()
-
+
+ show_text = self.attrs_changed ()
r,g,b = utils.selected_colors["fill"]
r *= 65536
g *= 65536
@@ -215,6 +213,11 @@
self.layout = pango.Layout (self.pango_context)
self.layout.set_text (show_text)
self.layout.set_attributes(self.attrlist)
+ self.recalc_position ()
+
+ def recalc_position (self):
+ if self.layout is None:
+ self.recalc_edges()
(x,y) = self.layout.get_pixel_size ()
margin = utils.margin_required (utils.STYLE_NORMAL)