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

Fix curve edit tangent points

They are working properly now
This commit is contained in:
Emmanouil Papadeas 2024-12-15 18:37:21 +02:00
parent 048058bd35
commit cf8dacf0f5
2 changed files with 6 additions and 5 deletions

View file

@ -22,12 +22,10 @@ var right_slope: CurveEditTangentPoint
func _ready() -> void:
gui_input.connect(_on_gui_input)
custom_minimum_size = Vector2(8, 8)
left_slope = CurveEditTangentPoint.new()
right_slope = CurveEditTangentPoint.new()
gui_input.connect(_on_gui_input)
left_slope.gui_input.connect(_on_gui_input)
right_slope.gui_input.connect(_on_gui_input)
add_child(left_slope)
add_child(right_slope)

View file

@ -6,7 +6,7 @@ extends Control
const OFFSET := -Vector2(0, 0)
@export var distance: float
@export var distance := 30
var moving = false
@onready var parent := get_parent() as CurveEditControlPoint
@ -14,7 +14,10 @@ var moving = false
func _ready() -> void:
gui_input.connect(_on_gui_input)
custom_minimum_size = Vector2(8, 8)
if get_index() == 0:
distance = -distance
func _draw() -> void:
@ -26,7 +29,7 @@ func _draw() -> void:
draw_circle(Vector2(3.0, 3.0), 3.0, color)
func _on_ControlPoint_gui_input(event: InputEvent) -> void:
func _on_gui_input(event: InputEvent) -> void:
if event is InputEventMouseButton:
if event.button_index == MOUSE_BUTTON_LEFT:
if event.pressed: