Fixed issue where the brush type select popup window chose brush type for the right tool instead of the left

This commit is contained in:
OverloadedOrama 2019-12-16 02:02:49 +02:00
parent ed42cdaef1
commit 6c14a7d5e2
3 changed files with 5 additions and 1 deletions

View file

@ -5,7 +5,7 @@ var custom_brush_index := -1
func _on_BrushButton_pressed() -> void:
#Change left brush
if Global.brushes_popup.rect_global_position == Global.left_brush_type_button.rect_global_position:
if Global.brush_type_window_position == "left":
Global.current_left_brush_type = brush_type
Global.custom_left_brush_index = custom_brush_index
if custom_brush_index > -1: #Custom brush

View file

@ -86,6 +86,8 @@ var right_brush_size := 1
var current_left_brush_type = BRUSH_TYPES.PIXEL
# warning-ignore:unused_class_variable
var current_right_brush_type = BRUSH_TYPES.PIXEL
# warning-ignore:unused_class_variable
var brush_type_window_position := "left"
var brushes_from_files := 0
# warning-ignore:unused_class_variable

View file

@ -734,9 +734,11 @@ func _on_RightIndicatorCheckbox_toggled(button_pressed) -> void:
func _on_LeftBrushTypeButton_pressed() -> void:
Global.brushes_popup.popup(Rect2(Global.left_brush_type_button.rect_global_position, Vector2(226, 72)))
Global.brush_type_window_position = "left"
func _on_RightBrushTypeButton_pressed() -> void:
Global.brushes_popup.popup(Rect2(Global.right_brush_type_button.rect_global_position, Vector2(226, 72)))
Global.brush_type_window_position = "right"
func _on_LeftBrushSizeEdit_value_changed(value) -> void:
var new_size = int(value)