mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 14:01:15 +02:00
Handle locking/unlocking items independently from the layer position.
This commit is contained in:
1 parent
3f7c4c0474
commit
724eda1f35
7 files changed
+42
-4
No files matched your search
@@ -37,7 +37,7 @@ class Drawing:
|
||||
text, images, rectangle... They are pure SVG elements.
|
||||
"""
|
||||
|
||||
def __init__(self, project, drawing_id=None, svg="<svg></svg>", x=0, y=0, z=2, rotation=0):
|
||||
def __init__(self, project, drawing_id=None, svg="<svg></svg>", x=0, y=0, z=2, locked=False, rotation=0):
|
||||
self._project = project
|
||||
if drawing_id is None:
|
||||
self._id = str(uuid.uuid4())
|
||||
@@ -49,6 +49,7 @@ class Drawing:
|
||||
self._y = y
|
||||
self._z = z
|
||||
self._rotation = rotation
|
||||
self._locked = locked
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
@@ -157,6 +158,14 @@ class Drawing:
|
||||
def z(self, val):
|
||||
self._z = val
|
||||
|
||||
@property
|
||||
def locked(self):
|
||||
return self._locked
|
||||
|
||||
@locked.setter
|
||||
def locked(self, val):
|
||||
self._locked = val
|
||||
|
||||
@property
|
||||
def rotation(self):
|
||||
return self._rotation
|
||||
@@ -198,6 +207,7 @@ class Drawing:
|
||||
"x": self._x,
|
||||
"y": self._y,
|
||||
"z": self._z,
|
||||
"locked": self._locked,
|
||||
"rotation": self._rotation,
|
||||
"svg": self._svg
|
||||
}
|
||||
@@ -207,6 +217,7 @@ class Drawing:
|
||||
"x": self._x,
|
||||
"y": self._y,
|
||||
"z": self._z,
|
||||
"locked": self._locked,
|
||||
"rotation": self._rotation,
|
||||
"svg": self.svg
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user