1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +00:00

Removed coord clamping from fill_gaps()

This should make line making behave as expected when the mouse is outside of canvas boundaries
This commit is contained in:
OverloadedOrama 2020-05-31 00:42:35 +03:00
parent 7a509a2047
commit 4fc2888b68
2 changed files with 2 additions and 4 deletions

View file

@ -258,8 +258,6 @@ func draw_brush(sprite : Image, pos : Vector2, color : Color, current_mouse_butt
func fill_gaps(sprite : Image, end_pos : Vector2, start_pos : Vector2, color : Color, current_mouse_button : String, pen_pressure : float, current_action := "None") -> void:
var previous_mouse_pos_floored = start_pos.floor()
var mouse_pos_floored = end_pos.floor()
mouse_pos_floored.x = clamp(mouse_pos_floored.x, Global.canvas.location.x - 1, Global.canvas.location.x + Global.canvas.size.x)
mouse_pos_floored.y = clamp(mouse_pos_floored.y, Global.canvas.location.y - 1, Global.canvas.location.y + Global.canvas.size.y)
var dx := int(abs(mouse_pos_floored.x - previous_mouse_pos_floored.x))
var dy := int(-abs(mouse_pos_floored.y - previous_mouse_pos_floored.y))
var err := dx + dy

View file

@ -238,8 +238,8 @@ func _notification(what : int) -> void:
show_quit_dialog()
func _on_files_dropped(files : PoolStringArray, _screen : int) -> void:
handle_loading_files(files)
func _on_files_dropped(_files : PoolStringArray, _screen : int) -> void:
handle_loading_files(_files)
func on_new_project_file_menu_option_pressed(id : int) -> void: