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

Revert "Fix cursor blinking at the edge of canvas (#1075)"

This reverts commit 77f6860f7a.
This commit is contained in:
Emmanouil Papadeas 2024-08-17 00:59:48 +03:00
parent 410f06435c
commit 29f9601d8a
2 changed files with 18 additions and 19 deletions

View file

@ -420,3 +420,7 @@ layout_mode = 2
[connection signal="mouse_entered" from="DockableContainer/Main Canvas/HorizontalRuler" to="DockableContainer/Main Canvas/HorizontalRuler" method="_on_HorizontalRuler_mouse_entered"]
[connection signal="pressed" from="DockableContainer/Main Canvas/HorizontalRuler" to="DockableContainer/Main Canvas/HorizontalRuler" method="_on_HorizontalRuler_pressed"]
[connection signal="pressed" from="DockableContainer/Main Canvas/ViewportandVerticalRuler/VerticalRuler" to="DockableContainer/Main Canvas/ViewportandVerticalRuler/VerticalRuler" method="_on_VerticalRuler_pressed"]
[connection signal="mouse_entered" from="DockableContainer/Main Canvas/ViewportandVerticalRuler/SubViewportContainer" to="DockableContainer/Main Canvas/ViewportandVerticalRuler/SubViewportContainer" method="_on_ViewportContainer_mouse_entered"]
[connection signal="mouse_exited" from="DockableContainer/Main Canvas/ViewportandVerticalRuler/SubViewportContainer" to="DockableContainer/Main Canvas/ViewportandVerticalRuler/SubViewportContainer" method="_on_ViewportContainer_mouse_exited"]
[connection signal="mouse_entered" from="DockableContainer/Second Canvas" to="DockableContainer/Second Canvas" method="_on_ViewportContainer_mouse_entered"]
[connection signal="mouse_exited" from="DockableContainer/Second Canvas" to="DockableContainer/Second Canvas" method="_on_ViewportContainer_mouse_exited"]

View file

@ -2,8 +2,6 @@ extends SubViewportContainer
@export var camera_path: NodePath
var _mouse_inside = false
@onready var camera := get_node(camera_path) as CanvasCamera
@ -12,19 +10,16 @@ func _ready() -> void:
material.blend_mode = CanvasItemMaterial.BLEND_MODE_PREMULT_ALPHA
func _input(event):
if event is InputEventMouseMotion:
if get_global_rect().has_point(event.position):
if !_mouse_inside:
_mouse_inside = true
func _on_ViewportContainer_mouse_entered() -> void:
camera.set_process_input(true)
Global.control.left_cursor.visible = Global.show_left_tool_icon
Global.control.right_cursor.visible = Global.show_right_tool_icon
if Global.cross_cursor:
Input.set_default_cursor_shape(Input.CURSOR_CROSS)
else:
if _mouse_inside:
_mouse_inside = false
func _on_ViewportContainer_mouse_exited() -> void:
camera.set_process_input(false)
camera.drag = false
Global.control.left_cursor.visible = false
Global.control.right_cursor.visible = false