fixes tapping while dragging issue
This commit is contained in:
parent
fc3a31d144
commit
d1ef1d6f4f
3
card.gd
3
card.gd
@ -44,7 +44,7 @@ func _pivot() -> int:
|
|||||||
func _physics_process(delta: float) -> void:
|
func _physics_process(delta: float) -> void:
|
||||||
if is_dragging == true:
|
if is_dragging == true:
|
||||||
var tween = get_tree().create_tween()
|
var tween = get_tree().create_tween()
|
||||||
tween.tween_property(self, "position", get_global_mouse_position() - mouse_offset.rotated(deg_to_rad(-1.0 * _pivot())), delay * delta)
|
tween.tween_property(self, "position", get_global_mouse_position() - mouse_offset, delay * delta)
|
||||||
if is_pivot == true:
|
if is_pivot == true:
|
||||||
var tween = get_tree().create_tween()
|
var tween = get_tree().create_tween()
|
||||||
tween.tween_property(self, "rotation_degrees", _pivot(), delta * delay)
|
tween.tween_property(self, "rotation_degrees", _pivot(), delta * delay)
|
||||||
@ -74,6 +74,7 @@ func _unhandled_key_input(event: InputEvent) -> void:
|
|||||||
else:
|
else:
|
||||||
current_pivot = pivot.ROTATE_0
|
current_pivot = pivot.ROTATE_0
|
||||||
is_pivot = true
|
is_pivot = true
|
||||||
|
set_pivot_offset(size / 2)
|
||||||
|
|
||||||
func _card_error(error_type: String) -> String:
|
func _card_error(error_type: String) -> String:
|
||||||
return "ERROR::CARD::%s::%s::%s::\n" % [card_id, card_name, error_type]
|
return "ERROR::CARD::%s::%s::%s::\n" % [card_id, card_name, error_type]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user