shapes: unlock before modifying during deepcopy
This commit is contained in:
parent
f2e6548d21
commit
25c9e591cb
6 changed files with 12 additions and 6 deletions
|
|
@ -165,10 +165,11 @@ class Arc(Shape):
|
|||
|
||||
def __deepcopy__(self, memo: Dict = None) -> 'Arc':
|
||||
memo = {} if memo is None else memo
|
||||
new = copy.copy(self)
|
||||
new = copy.copy(self).unlock()
|
||||
new._offset = self._offset.copy()
|
||||
new._radii = self._radii.copy()
|
||||
new._angles = self._angles.copy()
|
||||
new.locked = self.locked
|
||||
return new
|
||||
|
||||
def to_polygons(self,
|
||||
|
|
|
|||
|
|
@ -58,8 +58,9 @@ class Circle(Shape):
|
|||
|
||||
def __deepcopy__(self, memo: Dict = None) -> 'Circle':
|
||||
memo = {} if memo is None else memo
|
||||
new = copy.copy(self)
|
||||
new = copy.copy(self).unlock()
|
||||
new._offset = self._offset.copy()
|
||||
new.locked = self.locked
|
||||
return new
|
||||
|
||||
def to_polygons(self,
|
||||
|
|
|
|||
|
|
@ -104,9 +104,10 @@ class Ellipse(Shape):
|
|||
|
||||
def __deepcopy__(self, memo: Dict = None) -> 'Ellipse':
|
||||
memo = {} if memo is None else memo
|
||||
new = copy.copy(self)
|
||||
new = copy.copy(self).unlock()
|
||||
new._offset = self._offset.copy()
|
||||
new._radii = self._radii.copy()
|
||||
new.locked = self.locked
|
||||
return new
|
||||
|
||||
def to_polygons(self,
|
||||
|
|
|
|||
|
|
@ -171,11 +171,12 @@ class Path(Shape):
|
|||
|
||||
def __deepcopy__(self, memo: Dict = None) -> 'Path':
|
||||
memo = {} if memo is None else memo
|
||||
new = copy.copy(self)
|
||||
new = copy.copy(self).unlock()
|
||||
new._offset = self._offset.copy()
|
||||
new._vertices = self._vertices.copy()
|
||||
new._cap = copy.deepcopy(self._cap, memo)
|
||||
new._cap_extensions = copy.deepcopy(self._cap_extensions, memo)
|
||||
new.locked = self.locked
|
||||
return new
|
||||
|
||||
@staticmethod
|
||||
|
|
|
|||
|
|
@ -91,9 +91,10 @@ class Polygon(Shape):
|
|||
|
||||
def __deepcopy__(self, memo: Dict = None) -> 'Polygon':
|
||||
memo = {} if memo is None else memo
|
||||
new = copy.copy(self)
|
||||
new = copy.copy(self).unlock()
|
||||
new._offset = self._offset.copy()
|
||||
new._vertices = self._vertices.copy()
|
||||
new.locked = self.locked
|
||||
return new
|
||||
|
||||
@staticmethod
|
||||
|
|
|
|||
|
|
@ -94,9 +94,10 @@ class Text(Shape):
|
|||
|
||||
def __deepcopy__(self, memo: Dict = None) -> 'Text':
|
||||
memo = {} if memo is None else memo
|
||||
new = copy.copy(self)
|
||||
new = copy.copy(self).unlock()
|
||||
new._offset = self._offset.copy()
|
||||
new._mirrored = copy.deepcopy(self._mirrored, memo)
|
||||
new.locked = self.locked
|
||||
return new
|
||||
|
||||
def to_polygons(self,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue