Commit 0474cbd424063065024eb66c849f6d33a9aadec9

Authored by Thiago Franco de Moraes
1 parent 89a5f0fa

The use of ctrl and shift in the draw and erase pen

Showing 1 changed file with 12 additions and 0 deletions   Show diff stats
invesalius/data/styles.py
... ... @@ -570,6 +570,12 @@ class EditorInteractorStyle(DefaultInteractorStyle):
570 570 elif iren.GetShiftKey():
571 571 operation = const.BRUSH_THRESH_ADD_ONLY
572 572  
  573 + elif operation == const.BRUSH_ERASE and iren.GetControlKey():
  574 + operation = const.BRUSH_DRAW
  575 +
  576 + elif operation == const.BRUSH_DRAW and iren.GetControlKey():
  577 + operation = const.BRUSH_ERASE
  578 +
573 579 viewer._set_editor_cursor_visibility(1)
574 580  
575 581 mouse_x, mouse_y = iren.GetEventPosition()
... ... @@ -626,6 +632,12 @@ class EditorInteractorStyle(DefaultInteractorStyle):
626 632 elif iren.GetShiftKey():
627 633 operation = const.BRUSH_THRESH_ADD_ONLY
628 634  
  635 + elif operation == const.BRUSH_ERASE and iren.GetControlKey():
  636 + operation = const.BRUSH_DRAW
  637 +
  638 + elif operation == const.BRUSH_DRAW and iren.GetControlKey():
  639 + operation = const.BRUSH_ERASE
  640 +
629 641 # TODO: Improve!
630 642 #for i in self.slice_data_list:
631 643 #i.cursor.Show(0)
... ...