Commit 6448acbe authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Fix ensureVisible

parent b5976aa5
...@@ -1132,7 +1132,7 @@ class SDL_Scene(QtGui.QGraphicsScene, object): ...@@ -1132,7 +1132,7 @@ class SDL_Scene(QtGui.QGraphicsScene, object):
item.edit_text() item.edit_text()
for view in self.views(): for view in self.views():
view.refresh() view.view_refresh()
view.ensureVisible(item) view.ensureVisible(item)
return item return item
...@@ -1611,7 +1611,7 @@ class SDL_View(QtGui.QGraphicsView, object): ...@@ -1611,7 +1611,7 @@ class SDL_View(QtGui.QGraphicsView, object):
self.up_button.setEnabled(True) self.up_button.setEnabled(True)
self.set_toolbar() self.set_toolbar()
self.scene().scene_left.emit() self.scene().scene_left.emit()
self.refresh() self.view_refresh()
# pylint: disable=C0103 # pylint: disable=C0103
def mouseDoubleClickEvent(self, evt): def mouseDoubleClickEvent(self, evt):
...@@ -1932,7 +1932,7 @@ class SDL_View(QtGui.QGraphicsView, object): ...@@ -1932,7 +1932,7 @@ class SDL_View(QtGui.QGraphicsView, object):
self.scene().clear_focus() self.scene().clear_focus()
symbol.select() symbol.select()
self.scene().highlight(symbol) self.scene().highlight(symbol)
symbol.ensureVisible() self.ensureVisible(symbol)
else: else:
LOG.info('No symbol at given coordinates in the current scene') LOG.info('No symbol at given coordinates in the current scene')
......
...@@ -116,7 +116,11 @@ class InsertSymbol(QUndoCommand): ...@@ -116,7 +116,11 @@ class InsertSymbol(QUndoCommand):
self.item.show() self.item.show()
self.item.grabber.display() self.item.grabber.display()
try: try:
self.scene.refresh() # Immediate refresh for a better rendering, howerver slows down
# performance when inserting decisions in a complex model
#self.scene.refresh()
# Update only the connections - this is much faster
self.item.update_connections()
except AttributeError: except AttributeError:
pass pass
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment