|
|
@@ -101,8 +101,7 @@ class AppTool(QtWidgets.QWidget):
|
|
|
|
|
|
self.show()
|
|
|
|
|
|
- @classmethod
|
|
|
- def draw_tool_selection_shape(cls, old_coords, coords, **kwargs):
|
|
|
+ def draw_tool_selection_shape(self, old_coords, coords, **kwargs):
|
|
|
"""
|
|
|
|
|
|
:param old_coords: old coordinates
|
|
|
@@ -114,17 +113,17 @@ class AppTool(QtWidgets.QWidget):
|
|
|
if 'shapes_storage' in kwargs:
|
|
|
s_storage = kwargs['shapes_storage']
|
|
|
else:
|
|
|
- s_storage = cls.app.tool_shapes
|
|
|
+ s_storage = self.app.tool_shapes
|
|
|
|
|
|
if 'color' in kwargs:
|
|
|
color = kwargs['color']
|
|
|
else:
|
|
|
- color = cls.app.defaults['global_sel_line']
|
|
|
+ color = self.app.defaults['global_sel_line']
|
|
|
|
|
|
if 'face_color' in kwargs:
|
|
|
face_color = kwargs['face_color']
|
|
|
else:
|
|
|
- face_color = cls.app.defaults['global_sel_fill']
|
|
|
+ face_color = self.app.defaults['global_sel_fill']
|
|
|
|
|
|
if 'face_alpha' in kwargs:
|
|
|
face_alpha = kwargs['face_alpha']
|
|
|
@@ -146,11 +145,10 @@ class AppTool(QtWidgets.QWidget):
|
|
|
color_t = face_color[:-2] + str(hex(int(face_alpha * 255)))[2:]
|
|
|
|
|
|
s_storage.add(sel_rect, color=color, face_color=color_t, update=True, layer=0, tolerance=None)
|
|
|
- if cls.app.is_legacy is True:
|
|
|
+ if self.app.is_legacy is True:
|
|
|
s_storage.redraw()
|
|
|
|
|
|
- @classmethod
|
|
|
- def draw_selection_shape_polygon(cls, points, **kwargs):
|
|
|
+ def draw_selection_shape_polygon(self, points, **kwargs):
|
|
|
"""
|
|
|
|
|
|
:param points: a list of points from which to create a Polygon
|
|
|
@@ -161,17 +159,17 @@ class AppTool(QtWidgets.QWidget):
|
|
|
if 'shapes_storage' in kwargs:
|
|
|
s_storage = kwargs['shapes_storage']
|
|
|
else:
|
|
|
- s_storage = cls.app.tool_shapes
|
|
|
+ s_storage = self.app.tool_shapes
|
|
|
|
|
|
if 'color' in kwargs:
|
|
|
color = kwargs['color']
|
|
|
else:
|
|
|
- color = cls.app.defaults['global_sel_line']
|
|
|
+ color = self.app.defaults['global_sel_line']
|
|
|
|
|
|
if 'face_color' in kwargs:
|
|
|
face_color = kwargs['face_color']
|
|
|
else:
|
|
|
- face_color = cls.app.defaults['global_sel_fill']
|
|
|
+ face_color = self.app.defaults['global_sel_fill']
|
|
|
|
|
|
if 'face_alpha' in kwargs:
|
|
|
face_alpha = kwargs['face_alpha']
|
|
|
@@ -189,11 +187,10 @@ class AppTool(QtWidgets.QWidget):
|
|
|
color_t = face_color[:-2] + str(hex(int(face_alpha * 255)))[2:]
|
|
|
|
|
|
s_storage.add(sel_rect, color=color, face_color=color_t, update=True, layer=0, tolerance=None)
|
|
|
- if cls.app.is_legacy is True:
|
|
|
+ if self.app.is_legacy is True:
|
|
|
s_storage.redraw()
|
|
|
|
|
|
- @classmethod
|
|
|
- def delete_tool_selection_shape(cls, **kwargs):
|
|
|
+ def delete_tool_selection_shape(self, **kwargs):
|
|
|
"""
|
|
|
|
|
|
:param kwargs:
|
|
|
@@ -203,13 +200,12 @@ class AppTool(QtWidgets.QWidget):
|
|
|
if 'shapes_storage' in kwargs:
|
|
|
s_storage = kwargs['shapes_storage']
|
|
|
else:
|
|
|
- s_storage = cls.app.tool_shapes
|
|
|
+ s_storage = self.app.tool_shapes
|
|
|
|
|
|
s_storage.clear()
|
|
|
s_storage.redraw()
|
|
|
|
|
|
- @classmethod
|
|
|
- def draw_moving_selection_shape_poly(cls, points, data, **kwargs):
|
|
|
+ def draw_moving_selection_shape_poly(self, points, data, **kwargs):
|
|
|
"""
|
|
|
|
|
|
:param points:
|
|
|
@@ -221,17 +217,17 @@ class AppTool(QtWidgets.QWidget):
|
|
|
if 'shapes_storage' in kwargs:
|
|
|
s_storage = kwargs['shapes_storage']
|
|
|
else:
|
|
|
- s_storage = cls.app.move_tool.sel_shapes
|
|
|
+ s_storage = self.app.move_tool.sel_shapes
|
|
|
|
|
|
if 'color' in kwargs:
|
|
|
color = kwargs['color']
|
|
|
else:
|
|
|
- color = cls.app.defaults['global_sel_line']
|
|
|
+ color = self.app.defaults['global_sel_line']
|
|
|
|
|
|
if 'face_color' in kwargs:
|
|
|
face_color = kwargs['face_color']
|
|
|
else:
|
|
|
- face_color = cls.app.defaults['global_sel_fill']
|
|
|
+ face_color = self.app.defaults['global_sel_fill']
|
|
|
|
|
|
if 'face_alpha' in kwargs:
|
|
|
face_alpha = kwargs['face_alpha']
|
|
|
@@ -261,11 +257,10 @@ class AppTool(QtWidgets.QWidget):
|
|
|
elif not geo.is_valid:
|
|
|
s_storage.add(geo, color="red", face_color=color_t_error, update=True, layer=0, tolerance=None)
|
|
|
|
|
|
- if cls.app.is_legacy is True:
|
|
|
+ if self.app.is_legacy is True:
|
|
|
s_storage.redraw()
|
|
|
|
|
|
- @classmethod
|
|
|
- def delete_moving_selection_shape(cls, **kwargs):
|
|
|
+ def delete_moving_selection_shape(self, **kwargs):
|
|
|
"""
|
|
|
|
|
|
:param kwargs:
|
|
|
@@ -275,7 +270,7 @@ class AppTool(QtWidgets.QWidget):
|
|
|
if 'shapes_storage' in kwargs:
|
|
|
s_storage = kwargs['shapes_storage']
|
|
|
else:
|
|
|
- s_storage = cls.app.move_tool.sel_shapes
|
|
|
+ s_storage = self.app.move_tool.sel_shapes
|
|
|
|
|
|
s_storage.clear()
|
|
|
s_storage.redraw()
|