mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-30 23:19:49 +00:00
Fixes #618
This commit is contained in:
parent
28341a18d2
commit
92c252e22d
|
@ -149,7 +149,7 @@ boot_splash/bg_color=Color( 0.145098, 0.145098, 0.164706, 1 )
|
|||
config/icon="res://assets/graphics/icons/icon.png"
|
||||
config/macos_native_icon="res://assets/graphics/icons/icon.icns"
|
||||
config/windows_native_icon="res://assets/graphics/icons/icon.ico"
|
||||
config/Version="v0.9.1-rc1"
|
||||
config/Version="v0.9.1-rc2"
|
||||
run/low_processor_mode.Android=false
|
||||
|
||||
[audio]
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
class_name BaseTool
|
||||
extends VBoxContainer
|
||||
|
||||
var is_moving = false
|
||||
var kname: String
|
||||
var tool_slot = null # Tools.Slot, can't have static typing due to cyclic errors
|
||||
var cursor_text := ""
|
||||
|
@ -86,6 +87,21 @@ func update_config() -> void:
|
|||
pass
|
||||
|
||||
|
||||
func draw_start(_position: Vector2) -> void:
|
||||
is_moving = true
|
||||
|
||||
|
||||
func draw_move(position: Vector2) -> void:
|
||||
# This can happen if the user switches between tools with a shortcut
|
||||
# while using another tool
|
||||
if !is_moving:
|
||||
draw_start(position)
|
||||
|
||||
|
||||
func draw_end(_position: Vector2) -> void:
|
||||
is_moving = false
|
||||
|
||||
|
||||
func cursor_move(position: Vector2) -> void:
|
||||
_cursor = position
|
||||
|
||||
|
@ -165,3 +181,8 @@ func _add_polylines_segment(lines: Array, start: Vector2, end: Vector2) -> void:
|
|||
line.append(start)
|
||||
return
|
||||
lines.append([start, end])
|
||||
|
||||
|
||||
func _exit_tree() -> void:
|
||||
if is_moving:
|
||||
draw_end(Global.canvas.current_pixel.floor())
|
||||
|
|
|
@ -110,6 +110,7 @@ func update_pattern() -> void:
|
|||
|
||||
|
||||
func draw_start(position: Vector2) -> void:
|
||||
.draw_start(position)
|
||||
if Input.is_action_pressed("alt"):
|
||||
_pick_color(position)
|
||||
return
|
||||
|
@ -133,12 +134,12 @@ func draw_start(position: Vector2) -> void:
|
|||
commit_undo("Draw", undo_data)
|
||||
|
||||
|
||||
func draw_move(_position: Vector2) -> void:
|
||||
pass
|
||||
func draw_move(position: Vector2) -> void:
|
||||
.draw_move(position)
|
||||
|
||||
|
||||
func draw_end(_position: Vector2) -> void:
|
||||
pass
|
||||
func draw_end(position: Vector2) -> void:
|
||||
.draw_end(position)
|
||||
|
||||
|
||||
func fill_in_color(position: Vector2) -> void:
|
||||
|
|
|
@ -38,15 +38,17 @@ func update_config() -> void:
|
|||
|
||||
|
||||
func draw_start(position: Vector2) -> void:
|
||||
.draw_start(position)
|
||||
_pick_color(position)
|
||||
|
||||
|
||||
func draw_move(position: Vector2) -> void:
|
||||
.draw_move(position)
|
||||
_pick_color(position)
|
||||
|
||||
|
||||
func draw_end(_position: Vector2) -> void:
|
||||
pass
|
||||
func draw_end(position: Vector2) -> void:
|
||||
.draw_end(position)
|
||||
|
||||
|
||||
func _pick_color(position: Vector2) -> void:
|
||||
|
|
|
@ -35,6 +35,7 @@ func set_config(config: Dictionary) -> void:
|
|||
|
||||
|
||||
func draw_start(position: Vector2) -> void:
|
||||
.draw_start(position)
|
||||
if Input.is_action_pressed("alt"):
|
||||
_picking_color = true
|
||||
_pick_color(position)
|
||||
|
@ -62,6 +63,7 @@ func draw_start(position: Vector2) -> void:
|
|||
|
||||
|
||||
func draw_move(position: Vector2) -> void:
|
||||
.draw_move(position)
|
||||
if _picking_color: # Still return even if we released Alt
|
||||
if Input.is_action_pressed("alt"):
|
||||
_pick_color(position)
|
||||
|
@ -79,7 +81,8 @@ func draw_move(position: Vector2) -> void:
|
|||
Global.canvas.sprite_changed_this_frame = true
|
||||
|
||||
|
||||
func draw_end(_position: Vector2) -> void:
|
||||
func draw_end(position: Vector2) -> void:
|
||||
.draw_end(position)
|
||||
if _picking_color:
|
||||
return
|
||||
|
||||
|
|
|
@ -68,6 +68,7 @@ func _input(event: InputEvent) -> void:
|
|||
|
||||
|
||||
func draw_start(position: Vector2) -> void:
|
||||
.draw_start(position)
|
||||
if Input.is_action_pressed("alt"):
|
||||
_picking_color = true
|
||||
_pick_color(position)
|
||||
|
@ -85,6 +86,7 @@ func draw_start(position: Vector2) -> void:
|
|||
|
||||
|
||||
func draw_move(position: Vector2) -> void:
|
||||
.draw_move(position)
|
||||
if _picking_color: # Still return even if we released Alt
|
||||
if Input.is_action_pressed("alt"):
|
||||
_pick_color(position)
|
||||
|
@ -103,7 +105,8 @@ func draw_move(position: Vector2) -> void:
|
|||
_offset = position
|
||||
|
||||
|
||||
func draw_end(_position: Vector2) -> void:
|
||||
func draw_end(position: Vector2) -> void:
|
||||
.draw_end(position)
|
||||
if _picking_color:
|
||||
return
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@ func _input(event: InputEvent) -> void:
|
|||
|
||||
|
||||
func draw_start(position: Vector2) -> void:
|
||||
.draw_start(position)
|
||||
if !Global.current_project.layers[Global.current_project.current_layer].can_layer_get_drawn():
|
||||
return
|
||||
_start_pos = position
|
||||
|
@ -41,6 +42,7 @@ func draw_start(position: Vector2) -> void:
|
|||
|
||||
|
||||
func draw_move(position: Vector2) -> void:
|
||||
.draw_move(position)
|
||||
if !Global.current_project.layers[Global.current_project.current_layer].can_layer_get_drawn():
|
||||
return
|
||||
# This is true if content transformation has been confirmed (pressed Enter for example)
|
||||
|
@ -65,6 +67,7 @@ func draw_move(position: Vector2) -> void:
|
|||
|
||||
|
||||
func draw_end(position: Vector2) -> void:
|
||||
.draw_end(position)
|
||||
if !Global.current_project.layers[Global.current_project.current_layer].can_layer_get_drawn():
|
||||
return
|
||||
if (
|
||||
|
|
|
@ -1,15 +1,17 @@
|
|||
extends BaseTool
|
||||
|
||||
|
||||
func draw_start(_position: Vector2) -> void:
|
||||
func draw_start(position: Vector2) -> void:
|
||||
.draw_start(position)
|
||||
Global.camera.drag = true
|
||||
Global.camera2.drag = true
|
||||
|
||||
|
||||
func draw_move(_position: Vector2) -> void:
|
||||
pass
|
||||
func draw_move(position: Vector2) -> void:
|
||||
.draw_move(position)
|
||||
|
||||
|
||||
func draw_end(_position: Vector2) -> void:
|
||||
func draw_end(position: Vector2) -> void:
|
||||
.draw_end(position)
|
||||
Global.camera.drag = false
|
||||
Global.camera2.drag = false
|
||||
|
|
|
@ -70,6 +70,7 @@ func update_config() -> void:
|
|||
|
||||
|
||||
func draw_start(position: Vector2) -> void:
|
||||
.draw_start(position)
|
||||
if Input.is_action_pressed("alt"):
|
||||
_picking_color = true
|
||||
_pick_color(position)
|
||||
|
@ -101,6 +102,7 @@ func draw_start(position: Vector2) -> void:
|
|||
|
||||
|
||||
func draw_move(position: Vector2) -> void:
|
||||
.draw_move(position)
|
||||
if _picking_color: # Still return even if we released Alt
|
||||
if Input.is_action_pressed("alt"):
|
||||
_pick_color(position)
|
||||
|
@ -120,7 +122,8 @@ func draw_move(position: Vector2) -> void:
|
|||
_draw_points.append(position)
|
||||
|
||||
|
||||
func draw_end(_position: Vector2) -> void:
|
||||
func draw_end(position: Vector2) -> void:
|
||||
.draw_end(position)
|
||||
if _picking_color:
|
||||
return
|
||||
|
||||
|
@ -130,7 +133,7 @@ func draw_end(_position: Vector2) -> void:
|
|||
_draw_line = false
|
||||
else:
|
||||
if _fill_inside:
|
||||
_draw_points.append(_position)
|
||||
_draw_points.append(position)
|
||||
if _draw_points.size() > 3:
|
||||
var v = Vector2()
|
||||
var image_size = Global.current_project.size
|
||||
|
|
|
@ -61,6 +61,7 @@ func set_spinbox_values() -> void:
|
|||
|
||||
|
||||
func draw_start(position: Vector2) -> void:
|
||||
.draw_start(position)
|
||||
if selection_node.arrow_key_move:
|
||||
return
|
||||
var project: Project = Global.current_project
|
||||
|
@ -136,6 +137,7 @@ func draw_start(position: Vector2) -> void:
|
|||
|
||||
|
||||
func draw_move(position: Vector2) -> void:
|
||||
.draw_move(position)
|
||||
if selection_node.arrow_key_move:
|
||||
return
|
||||
# This is true if content transformation has been confirmed (pressed Enter for example)
|
||||
|
@ -162,14 +164,15 @@ func draw_move(position: Vector2) -> void:
|
|||
_set_cursor_text(selection_node.big_bounding_rectangle)
|
||||
|
||||
|
||||
func draw_end(_position: Vector2) -> void:
|
||||
func draw_end(position: Vector2) -> void:
|
||||
.draw_end(position)
|
||||
if selection_node.arrow_key_move:
|
||||
return
|
||||
if _content_transformation_check == selection_node.is_moving_content:
|
||||
if _move:
|
||||
selection_node.move_borders_end()
|
||||
else:
|
||||
apply_selection(_position)
|
||||
apply_selection(position)
|
||||
|
||||
_move = false
|
||||
_snap_to_grid = false
|
||||
|
|
|
@ -210,6 +210,7 @@ func update_strength() -> void:
|
|||
|
||||
|
||||
func draw_start(position: Vector2) -> void:
|
||||
.draw_start(position)
|
||||
if Input.is_action_pressed("alt"):
|
||||
_picking_color = true
|
||||
_pick_color(position)
|
||||
|
@ -237,6 +238,7 @@ func draw_start(position: Vector2) -> void:
|
|||
|
||||
|
||||
func draw_move(position: Vector2) -> void:
|
||||
.draw_move(position)
|
||||
if _picking_color: # Still return even if we released Alt
|
||||
if Input.is_action_pressed("alt"):
|
||||
_pick_color(position)
|
||||
|
@ -254,7 +256,8 @@ func draw_move(position: Vector2) -> void:
|
|||
Global.canvas.sprite_changed_this_frame = true
|
||||
|
||||
|
||||
func draw_end(_position: Vector2) -> void:
|
||||
func draw_end(position: Vector2) -> void:
|
||||
.draw_end(position)
|
||||
if _picking_color:
|
||||
return
|
||||
|
||||
|
|
|
@ -83,6 +83,7 @@ func _input(event: InputEvent) -> void:
|
|||
|
||||
|
||||
func draw_start(position: Vector2) -> void:
|
||||
.draw_start(position)
|
||||
if Input.is_action_pressed("alt"):
|
||||
_picking_color = true
|
||||
_pick_color(position)
|
||||
|
@ -99,6 +100,7 @@ func draw_start(position: Vector2) -> void:
|
|||
|
||||
|
||||
func draw_move(position: Vector2) -> void:
|
||||
.draw_move(position)
|
||||
if _picking_color: # Still return even if we released Alt
|
||||
if Input.is_action_pressed("alt"):
|
||||
_pick_color(position)
|
||||
|
@ -113,6 +115,7 @@ func draw_move(position: Vector2) -> void:
|
|||
|
||||
|
||||
func draw_end(position: Vector2) -> void:
|
||||
.draw_end(position)
|
||||
if _picking_color:
|
||||
return
|
||||
|
||||
|
|
|
@ -47,7 +47,8 @@ func update_config() -> void:
|
|||
$ModeOptions.selected = _zoom_mode
|
||||
|
||||
|
||||
func draw_start(_position: Vector2) -> void:
|
||||
func draw_start(position: Vector2) -> void:
|
||||
.draw_start(position)
|
||||
var mouse_pos := get_global_mouse_position()
|
||||
var viewport_rect := Rect2(
|
||||
Global.main_viewport.rect_global_position, Global.main_viewport.rect_size
|
||||
|
@ -62,9 +63,10 @@ func draw_start(_position: Vector2) -> void:
|
|||
Global.camera2.zoom_camera(_zoom_mode * 2 - 1)
|
||||
|
||||
|
||||
func draw_move(_position: Vector2) -> void:
|
||||
func draw_move(position: Vector2) -> void:
|
||||
.draw_move(position)
|
||||
Global.camera.zoom_camera(-_relative.x / 3)
|
||||
|
||||
|
||||
func draw_end(_position: Vector2) -> void:
|
||||
pass
|
||||
func draw_end(position: Vector2) -> void:
|
||||
.draw_end(position)
|
||||
|
|
Loading…
Reference in a new issue