Commit cfbcf96f authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Reduce calls to CAM and optimize loading with no cif

parent 8e8e57bf
......@@ -144,6 +144,7 @@ Changelog
1.3.22 (05/2016)
- Bux fix in range checks for division and subtraction
- Optimise loading when there are no CIF comments
1.3.21 (05/2016)
- Complete support of optional fields
......
......@@ -607,6 +607,7 @@ class Symbol(QObject, QGraphicsPathItem, object):
# Call the Qt event prcessing to avoid blocking the application
# Removed (had bad visual side effects)
# QApplication.processEvents()
#print 'CAM', unicode(self)[slice(0, 20)]
ignore = ignore or []
if not self.scene():
# Make sure the item is in a scene. For instance, when loading
......@@ -743,7 +744,7 @@ class Comment(Symbol):
self.pos_y = y if y is not None else (parent.boundingRect().height() -
self.boundingRect().height()) / 2
self.connection = self.connect_to_parent()
parent.cam(parent.position, parent.position)
#parent.cam(parent.position, parent.position)
def connect_to_parent(self):
''' Redefinition of the function to use a comment connector '''
......@@ -993,7 +994,7 @@ class HorizontalSymbol(Symbol, object):
self.position = QPointF(pos_x, pos_y)
self.connection = self.connect_to_parent()
self.updateConnectionPoints()
self.cam(self.position, self.position)
#self.cam(self.position, self.position)
def update_connections(self):
'''
......@@ -1217,7 +1218,7 @@ class VerticalSymbol(Symbol, object):
self.updateConnectionPoints()
if y is not None:
self.pos_y = y
self.cam(self.position, self.position)
#self.cam(self.position, self.position)
def mouse_move(self, event):
''' Click and move: forbid symbol to move on the x axis '''
......
......@@ -553,8 +553,14 @@ class SDL_Scene(QtGui.QGraphicsScene, object):
symbol.parent.boundingRect().width() + 15
symbol.pos_y = 0
if not symbol.hasParent:
symbol.cam(symbol.position,
symbol.position)
#print 'Positionning', unicode(symbol)[slice(0,20)]
sc_br = dest_scene.itemsBoundingRect()
sy_br = symbol.mapRectToScene(
symbol.boundingRect() |
symbol.childrenBoundingRect())
symbol.pos_x += (sc_br.width() - sy_br.x())
# symbol.cam(symbol.position,
# symbol.position)
except AttributeError:
# no AST, ignore (e.g. Connections, Cornergrabbers)
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