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:
parent
048058bd35
commit
cf8dacf0f5
|
@ -22,12 +22,10 @@ var right_slope: CurveEditTangentPoint
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
|
gui_input.connect(_on_gui_input)
|
||||||
custom_minimum_size = Vector2(8, 8)
|
custom_minimum_size = Vector2(8, 8)
|
||||||
left_slope = CurveEditTangentPoint.new()
|
left_slope = CurveEditTangentPoint.new()
|
||||||
right_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(left_slope)
|
||||||
add_child(right_slope)
|
add_child(right_slope)
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ extends Control
|
||||||
|
|
||||||
const OFFSET := -Vector2(0, 0)
|
const OFFSET := -Vector2(0, 0)
|
||||||
|
|
||||||
@export var distance: float
|
@export var distance := 30
|
||||||
|
|
||||||
var moving = false
|
var moving = false
|
||||||
@onready var parent := get_parent() as CurveEditControlPoint
|
@onready var parent := get_parent() as CurveEditControlPoint
|
||||||
|
@ -14,7 +14,10 @@ var moving = false
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
|
gui_input.connect(_on_gui_input)
|
||||||
custom_minimum_size = Vector2(8, 8)
|
custom_minimum_size = Vector2(8, 8)
|
||||||
|
if get_index() == 0:
|
||||||
|
distance = -distance
|
||||||
|
|
||||||
|
|
||||||
func _draw() -> void:
|
func _draw() -> void:
|
||||||
|
@ -26,7 +29,7 @@ func _draw() -> void:
|
||||||
draw_circle(Vector2(3.0, 3.0), 3.0, color)
|
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 is InputEventMouseButton:
|
||||||
if event.button_index == MOUSE_BUTTON_LEFT:
|
if event.button_index == MOUSE_BUTTON_LEFT:
|
||||||
if event.pressed:
|
if event.pressed:
|
||||||
|
|
Loading…
Reference in a new issue