Skip to content
Snippets Groups Projects
Commit 1628fa03 authored by HarshaRani's avatar HarshaRani
Browse files

Squashed 'moose-gui/' changes from 1ef13c9-1ef13c9

parent f0054556
No related branches found
No related tags found
No related merge requests found
......@@ -129,12 +129,13 @@ def handleCollisions(compartments, moveCallback, layoutPt,margin = 5.0):
def calculateChildBoundingRect(compt):
''' In this function I am trying to calculate BoundingRect of the compartments
looking into children and its children which default "ChildrenBoundingRect"
function doing but in multi-compartment cross-compartment reaction
function was doing it but in multi-compartment cross-compartment reaction
the arrow width is taken into account which doesn't belong to this perticular compartment
'''
ypos = []
xpos = []
for l in compt.childItems():
''' All the children including pool,reac,enz,polygon(arrow),table '''
if not isinstance(l,QtSvg.QGraphicsSvgItem):
xpos.append((l.pos().x())+(l.boundingRect().bottomRight().x()))
......@@ -154,5 +155,9 @@ def calculateChildBoundingRect(compt):
(not isinstance(ll,QtGui.QGraphicsEllipseItem))
):
ypos.append(l.pos().y()+ll.pos().y()+ll.boundingRect().bottomRight().y())
calculateRectcompt = QtCore.QRectF(min(xpos),min(ypos),(max(xpos)-min(xpos)),(max(ypos)-min(ypos)))
if xpos and ypos:
calculateRectcompt = QtCore.QRectF(min(xpos),min(ypos),(max(xpos)-min(xpos)),(max(ypos)-min(ypos)))
else:
calculateRectcompt = compt.rect()
return calculateRectcompt
\ No newline at end of file
......@@ -44,7 +44,7 @@ def checkCreate(scene,view,modelpath,mobj,string,ret_string,num,event_pos,layout
mobj.volume = 1e-15
mesh = moose.element(mobj.path+'/mesh')
qGItem = ComptItem(scene,pos.toPoint().x(),pos.toPoint().y(),500,500,mobj)
qGItem = ComptItem(scene,pos.toPoint().x(),pos.toPoint().y(),100,100,mobj)
qGItem.setPen(QtGui.QPen(Qt.QColor(66,66,66,100), 1, Qt.Qt.SolidLine, Qt.Qt.RoundCap, Qt.Qt.RoundJoin))
view.sceneContainerPt.addItem(qGItem)
qGItem.cmptEmitter.connect(qGItem.cmptEmitter,QtCore.SIGNAL("qgtextPositionChange(PyQt_PyObject)"),layoutPt.positionChange1)
......
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