@ -75,9 +75,9 @@ class CCPath(QtWidgets.QGraphicsRectItem):
returnsuper().itemChange(changeEnum,value)
defmousePressEvent(self,event):
defmousePressEventToAdd(self,event):
ifevent.button()==1:#QtCore.Qt.LeftButton
self.add(event.pos())
self.add(event)
@property
defitems(self):
@ -215,14 +215,15 @@ class CCPath(QtWidgets.QGraphicsRectItem):
assert0<=newCCValue<128
returnnewCCValue
defadd(self,qPos):
defadd(self,event):
"""Only activated through the hover area which gives are the
mostcontroloverwhereclicksareallowed.
AlsotherewasaweirdbugthattheCCPathitselfcannot
detectmouseclicksintherightposition"""
y=qPos.y()
"""
pos=self.mapFromScene(event.scenePos())
x=pos.x()
y=pos.y()
if-28<y<28:
sp=qPos.x()*constantsAndConfigs.ticksToPixelRatio
sp=x*constantsAndConfigs.ticksToPixelRatio
blockId,blockStartOffset=self.blocKByPosition(sp)#get the block before rounding. Otherwise rounding might result in a position higher than the blocks duration