Added Group-level delete function, fixed selection being broken after vector editing
This commit is contained in:
parent
c3bed8df36
commit
879a7c18a9
|
|
@ -2413,6 +2413,7 @@ class Layer:
|
||||||
print "#>>",i
|
print "#>>",i
|
||||||
for j in self.frames[self.currentframe].objs:
|
for j in self.frames[self.currentframe].objs:
|
||||||
if j == i:
|
if j == i:
|
||||||
|
print "Deleting",j
|
||||||
del self.currentFrame()[self.currentFrame().index(j)]
|
del self.currentFrame()[self.currentFrame().index(j)]
|
||||||
def add_frame(self,populate):
|
def add_frame(self,populate):
|
||||||
if self.activeframe>len(self.frames):
|
if self.activeframe>len(self.frames):
|
||||||
|
|
@ -2634,6 +2635,8 @@ class Group (object):
|
||||||
i.draw(cr, rect=rect)
|
i.draw(cr, rect=rect)
|
||||||
def add(self, *args):
|
def add(self, *args):
|
||||||
self.activelayer.add(*args)
|
self.activelayer.add(*args)
|
||||||
|
def delete(self, *args):
|
||||||
|
self.activelayer.delete(*args)
|
||||||
def add_frame(self, populate):
|
def add_frame(self, populate):
|
||||||
self.activelayer.add_frame(populate)
|
self.activelayer.add_frame(populate)
|
||||||
def add_layer(self, index):
|
def add_layer(self, index):
|
||||||
|
|
@ -2782,7 +2785,7 @@ class Group (object):
|
||||||
# If we have a selection
|
# If we have a selection
|
||||||
if self.activelayer.currentselect:
|
if self.activelayer.currentselect:
|
||||||
self.activelayer.currentselect._onMouseUp(x, y, button=button, clicks=clicks)
|
self.activelayer.currentselect._onMouseUp(x, y, button=button, clicks=clicks)
|
||||||
# COMMENT PLZ
|
# If we have a point that we're dragging around (vector editing)
|
||||||
elif self.activepoint:
|
elif self.activepoint:
|
||||||
for i in self.lines:
|
for i in self.lines:
|
||||||
if abs(self.activepoint.x-i.endpoint1.x)<10 and abs(self.activepoint.y-i.endpoint1.y)<10:
|
if abs(self.activepoint.x-i.endpoint1.x)<10 and abs(self.activepoint.y-i.endpoint1.y)<10:
|
||||||
|
|
@ -2802,6 +2805,7 @@ class Group (object):
|
||||||
break
|
break
|
||||||
except IndexError: pass
|
except IndexError: pass
|
||||||
break
|
break
|
||||||
|
self.activepoint = None
|
||||||
# if neither of those, but we've dragged the mouse at least 4 pixels in either axis
|
# if neither of those, but we've dragged the mouse at least 4 pixels in either axis
|
||||||
elif abs(self.startx-x)>4 or abs(self.starty-y)>4:
|
elif abs(self.startx-x)>4 or abs(self.starty-y)>4:
|
||||||
# this should make a temporary group containing all the objects within the area we dragged
|
# this should make a temporary group containing all the objects within the area we dragged
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue