Turn Symmetry Guides visibility on and off if mirroring is enabled

Also fixed issue with "Show Guides" view menu option and having multiple projects with guides. Only think remaining is to make the Symmetry Guides look different than regular guides. Closes #133.
This commit is contained in:
OverloadedOrama 2020-07-16 05:05:40 +03:00
parent 9fa91ffd8e
commit a5a8bf1fe5
6 changed files with 26 additions and 2 deletions

View file

@ -27,11 +27,21 @@ func _on_PixelPerfect_toggled(button_pressed : bool):
func _on_Horizontal_toggled(button_pressed : bool):
tool_slot.horizontal_mirror = button_pressed
tool_slot.save_config()
Global.show_y_symmetry_axis = button_pressed
# If the button is not pressed but another button is, keep the symmetry guide visible
if !button_pressed and (Tools._slots[BUTTON_LEFT].horizontal_mirror or Tools._slots[BUTTON_RIGHT].horizontal_mirror):
Global.show_y_symmetry_axis = true
Global.current_project.y_symmetry_axis.visible = Global.show_y_symmetry_axis and Global.show_guides
func _on_Vertical_toggled(button_pressed : bool):
tool_slot.vertical_mirror = button_pressed
tool_slot.save_config()
Global.show_x_symmetry_axis = button_pressed
# If the button is not pressed but another button is, keep the symmetry guide visible
if !button_pressed and (Tools._slots[BUTTON_LEFT].vertical_mirror or Tools._slots[BUTTON_RIGHT].vertical_mirror):
Global.show_x_symmetry_axis = true
Global.current_project.x_symmetry_axis.visible = Global.show_x_symmetry_axis and Global.show_guides
func save_config() -> void: