Skip to content

Ruler, Knife and Polygon tools stopped working in some relatively recent commit

  1. Run in debug mode, open a project with a photo.
  2. Select the "Ruler" tool.
  3. Try to drag a ruler. On the first mouse LMB down, the program crashes:
activating tool id 4
Traceback (most recent call last):
  File "D:\work\arthropods\arthropoddescriber2repository\arthropod_describer_py\arthropod_describer\common\layer.py", line 112, in mousePressEvent
    layer.mouse_press(event)
  File "D:\work\arthropods\arthropoddescriber2repository\arthropod_describer_py\arthropod_describer\common\visualization_layer.py", line 81, in mouse_press
    self.paint_commands = self.current_tool.viz_left_press(event.pos().toPoint(), self.canvas)
  File "D:\work\arthropods\arthropoddescriber2repository\arthropod_describer_py\arthropod_describer\tools\ruler.py", line 92, in viz_left_press
    self.viz_right_release(pos)
TypeError: viz_right_release() missing 1 required positional argument: 'canvas'

Process finished with exit code 1

The same happens with the "Knife" or the "Polygon" tools:

activating tool id 2
Traceback (most recent call last):
  File "D:\work\arthropods\arthropoddescriber2repository\arthropod_describer_py\arthropod_describer\common\layer.py", line 112, in mousePressEvent
    layer.mouse_press(event)
  File "D:\work\arthropods\arthropoddescriber2repository\arthropod_describer_py\arthropod_describer\common\visualization_layer.py", line 81, in mouse_press
    self.paint_commands = self.current_tool.viz_left_press(event.pos().toPoint(), self.canvas)
  File "D:\work\arthropods\arthropoddescriber2repository\arthropod_describer_py\arthropod_describer\tools\knife.py", line 113, in viz_left_press
    return self.viz_mouse_move(pos, pos)
TypeError: viz_mouse_move() missing 1 required positional argument: 'canvas'

Process finished with exit code 1
activating tool id 3
Traceback (most recent call last):
  File "D:\work\arthropods\arthropoddescriber2repository\arthropod_describer_py\arthropod_describer\common\layer.py", line 105, in mouseMoveEvent
    layer.mouse_move(event)
  File "D:\work\arthropods\arthropoddescriber2repository\arthropod_describer_py\arthropod_describer\common\visualization_layer.py", line 89, in mouse_move
    self.paint_commands = self.current_tool.viz_mouse_move(event.pos().toPoint(),
  File "D:\work\arthropods\arthropoddescriber2repository\arthropod_describer_py\arthropod_describer\tools\polygon.py", line 164, in viz_mouse_move
    return self.viz_hover_move(new_pos, old_pos)
TypeError: viz_hover_move() missing 1 required positional argument: 'canvas'

Process finished with exit code 1