mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-03-12 22:35:18 +00:00
Move Guides without moving mouse outside canvas (#647)
* guide movement enhancement * Gave more access to pan tool * Update Guide.gd * Update Guide.gd * Update Tools.gd
This commit is contained in:
parent
74df57ed70
commit
25fd6026be
3 changed files with 10 additions and 1 deletions
|
@ -22,6 +22,7 @@ var ui_tooltips := {}
|
|||
# Canvas related stuff
|
||||
var layers_changed_skip := false
|
||||
var can_draw := false
|
||||
var move_guides_on_canvas := false
|
||||
var has_focus := false
|
||||
|
||||
var play_only_tags := true
|
||||
|
|
|
@ -99,6 +99,11 @@ func set_tool(name: String, button: int) -> void:
|
|||
var slot = _slots[button]
|
||||
var panel: Node = _panels[button]
|
||||
var node: Node = _tools[name].instance()
|
||||
if button == BUTTON_LEFT: # As guides are only moved with left mouse
|
||||
if name == "Pan": # tool you want to give more access at guides
|
||||
Global.move_guides_on_canvas = true
|
||||
else:
|
||||
Global.move_guides_on_canvas = false
|
||||
node.name = name
|
||||
node.tool_slot = slot
|
||||
slot.tool_node = node
|
||||
|
|
|
@ -41,7 +41,10 @@ func _input(_event: InputEvent) -> void:
|
|||
and point_in_rectangle(mouse_pos, point0, point1)
|
||||
and Input.is_action_just_pressed("left_mouse")
|
||||
):
|
||||
if !point_in_rectangle(Global.canvas.current_pixel, Vector2.ZERO, project.size):
|
||||
if (
|
||||
!point_in_rectangle(Global.canvas.current_pixel, Vector2.ZERO, project.size)
|
||||
or Global.move_guides_on_canvas
|
||||
):
|
||||
has_focus = true
|
||||
Global.has_focus = false
|
||||
update()
|
||||
|
|
Loading…
Add table
Reference in a new issue