Fixed the bucket tool.

This commit is contained in:
Relintai 2022-11-18 13:42:01 +01:00
parent 3c69709c19
commit da9b93fef6
2 changed files with 5 additions and 15 deletions

View File

@ -61,8 +61,10 @@ func handle_left_mouse_button_down(local_position : Vector2, event: InputEvent)
var arr : Array = Array()
arr.push_back(cell_mouse_position)
arr.push_back(last_cell_mouse_position)
#STORE color here
arr.push_back(get_current_color())
do_action(arr)
commit_action()
elif current_tool == TOOL_COLORPICKER:
var c : Color = get_pixel(cell_mouse_position.x, cell_mouse_position.y);
@ -104,16 +106,6 @@ func handle_right_mouse_button_down(local_position : Vector2, event: InputEvent)
if current_tool == TOOL_CUT:
if !event.is_pressed():
commit_action()
elif current_tool == TOOL_BUCKET:
if !_current_action:
_current_action = get_action()
var arr : Array = Array()
arr.push_back(cell_mouse_position)
arr.push_back(last_cell_mouse_position)
arr.push_back(get_current_color())
do_action(arr)
elif current_tool == TOOL_COLORPICKER:
current_tool = get_previous_tool()
elif current_tool == TOOL_PASTECUT:
@ -331,8 +323,7 @@ func _on_tool_changed() -> void:
_selection_cells.resize(0);
_selection_colors.resize(0);
if get_previous_tool() != TOOL_BUCKET:
_current_action = get_action()
_current_action = get_action()
func tool_process(local_position : Vector2, event: InputEvent) -> void:
if current_tool == TOOL_COLORPICKER:

View File

@ -28,7 +28,7 @@ size = Vector2( 32, 32 )
[node name="PaintProject" type="PaintProject"]
size = Vector2i( 128, 128 )
current_color = Color( 0.960784, 0.376471, 0.0392157, 1 )
current_color = Color( 0.0666667, 0.796078, 0.196078, 1 )
color_presets = PoolColorArray( 0.67914, 0.117493, 0.0852439, 1, 0.129412, 0.113725, 0.384314, 1, 0.0666667, 0.796078, 0.196078, 1, 0.0666667, 0.796078, 0.196078, 1, 0.964706, 0.992157, 0.121569, 1, 0.00784314, 0.835294, 0.564706, 1, 0.0666667, 0.796078, 0.196078, 1, 0.658824, 0.313726, 0.207843, 1 )
script = ExtResource( 2 )
@ -50,5 +50,4 @@ script = ExtResource( 3 )
size = Vector2i( 128, 128 )
brush_prefab = 1
brush_size = 3
current_tool = 2
script = ExtResource( 1 )