1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-02-07 10:59:49 +00:00

Fixed issue where Shift and Ctrl weren't working with straight lines on Canvas.gd

This commit is contained in:
OverloadedOrama 2019-12-27 17:38:43 +02:00
parent 080676ac83
commit 42e3aec561

View file

@ -81,14 +81,19 @@ func camera_zoom() -> void:
Global.camera_preview.offset = size / 2 Global.camera_preview.offset = size / 2
func _input(event : InputEvent) -> void: 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. # This decreases CPU/GPU usage slightly.
if not event is InputEventMouse: if not event is InputEventMouse:
if event is InputEventKey:
if event.scancode != KEY_SHIFT && event.scancode != KEY_CONTROL:
return
else:
return return
sprite_changed_this_frame = false if Global.current_frame == frame && Global.has_focus:
if Global.current_frame == frame:
update() update()
sprite_changed_this_frame = false
current_pixel = get_local_mouse_position() - location current_pixel = get_local_mouse_position() - location
var mouse_pos := current_pixel var mouse_pos := current_pixel
var mouse_pos_floored := mouse_pos.floor() var mouse_pos_floored := mouse_pos.floor()
@ -100,6 +105,7 @@ func _input(event : InputEvent) -> void:
# For the LightenDarken tool # For the LightenDarken tool
var ld := 0 var ld := 0
var ld_amount := 0.1 var ld_amount := 0.1
if Input.is_mouse_button_pressed(BUTTON_LEFT): if Input.is_mouse_button_pressed(BUTTON_LEFT):
current_mouse_button = "left_mouse" current_mouse_button = "left_mouse"
current_action = Global.current_left_tool current_action = Global.current_left_tool