mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-05-06 01:04:49 -04:00
Fixed issue where Shift and Ctrl weren't working with straight lines on Canvas.gd
This commit is contained in:
parent
080676ac83
commit
42e3aec561
1 changed files with 19 additions and 13 deletions
|
@ -81,14 +81,19 @@ func camera_zoom() -> void:
|
|||
Global.camera_preview.offset = size / 2
|
||||
|
||||
func _input(event : InputEvent) -> void:
|
||||
# Don't process anything below if the input isn't a mouse event.
|
||||
# Don't process anything below if the input isn't a mouse event, or Shift/Ctrl.
|
||||
# This decreases CPU/GPU usage slightly.
|
||||
if not event is InputEventMouse:
|
||||
if event is InputEventKey:
|
||||
if event.scancode != KEY_SHIFT && event.scancode != KEY_CONTROL:
|
||||
return
|
||||
else:
|
||||
return
|
||||
|
||||
sprite_changed_this_frame = false
|
||||
if Global.current_frame == frame:
|
||||
if Global.current_frame == frame && Global.has_focus:
|
||||
update()
|
||||
|
||||
sprite_changed_this_frame = false
|
||||
current_pixel = get_local_mouse_position() - location
|
||||
var mouse_pos := current_pixel
|
||||
var mouse_pos_floored := mouse_pos.floor()
|
||||
|
@ -100,6 +105,7 @@ func _input(event : InputEvent) -> void:
|
|||
# For the LightenDarken tool
|
||||
var ld := 0
|
||||
var ld_amount := 0.1
|
||||
|
||||
if Input.is_mouse_button_pressed(BUTTON_LEFT):
|
||||
current_mouse_button = "left_mouse"
|
||||
current_action = Global.current_left_tool
|
||||
|
|
Loading…
Add table
Reference in a new issue