mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-18 09:09:47 +00:00
Remove unneeded has_focus checks
This commit is contained in:
parent
d9c0cd7546
commit
42de5ccb29
|
@ -541,8 +541,7 @@ func handle_draw(position: Vector2i, event: InputEvent) -> void:
|
|||
|
||||
var project := Global.current_project
|
||||
var text := "[%s×%s]" % [project.size.x, project.size.y]
|
||||
if Global.has_focus:
|
||||
text += " %s, %s" % [position.x, position.y]
|
||||
text += " %s, %s" % [position.x, position.y]
|
||||
if not _slots[MOUSE_BUTTON_LEFT].tool_node.cursor_text.is_empty():
|
||||
text += " %s" % _slots[MOUSE_BUTTON_LEFT].tool_node.cursor_text
|
||||
if not _slots[MOUSE_BUTTON_RIGHT].tool_node.cursor_text.is_empty():
|
||||
|
|
|
@ -91,8 +91,7 @@ func _input(event: InputEvent) -> void:
|
|||
Tools.handle_draw(Vector2i(current_pixel.floor()), event)
|
||||
|
||||
if sprite_changed_this_frame:
|
||||
if Global.has_focus:
|
||||
queue_redraw()
|
||||
queue_redraw()
|
||||
update_selected_cels_textures()
|
||||
|
||||
|
||||
|
|
|
@ -2,12 +2,11 @@ extends Node2D
|
|||
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if Global.has_focus:
|
||||
if event is InputEventMouse or event is InputEventKey:
|
||||
queue_redraw()
|
||||
if event is InputEventMouse or event is InputEventKey:
|
||||
queue_redraw()
|
||||
|
||||
|
||||
func _draw() -> void:
|
||||
# Draw rectangle to indicate the pixel currently being hovered on
|
||||
if Global.has_focus and Global.can_draw:
|
||||
if Global.can_draw:
|
||||
Tools.draw_indicator()
|
||||
|
|
|
@ -29,7 +29,7 @@ func draw_guide_line():
|
|||
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if !Global.show_mouse_guides or !Global.can_draw or !Global.has_focus:
|
||||
if !Global.show_mouse_guides or !Global.can_draw:
|
||||
visible = false
|
||||
return
|
||||
visible = true
|
||||
|
|
|
@ -2,11 +2,10 @@ extends Node2D
|
|||
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if Global.has_focus:
|
||||
if event is InputEventMouse or event is InputEventKey:
|
||||
queue_redraw()
|
||||
if event is InputEventMouse or event is InputEventKey:
|
||||
queue_redraw()
|
||||
|
||||
|
||||
func _draw() -> void:
|
||||
if Global.has_focus and Global.can_draw:
|
||||
if Global.can_draw:
|
||||
Tools.draw_preview()
|
||||
|
|
|
@ -39,7 +39,6 @@ func _input(_event: InputEvent) -> void:
|
|||
if (
|
||||
Input.is_action_just_pressed(&"left_mouse")
|
||||
and Global.can_draw
|
||||
and Global.has_focus
|
||||
and rect.has_point(mouse_pos)
|
||||
):
|
||||
if (
|
||||
|
|
|
@ -65,7 +65,7 @@ func _input(event: InputEvent) -> void:
|
|||
var project_size := Global.current_project.size
|
||||
|
||||
if track_mouse:
|
||||
if !Global.can_draw or !Global.has_focus or Global.perspective_editor.tracker_disabled:
|
||||
if !Global.can_draw or Global.perspective_editor.tracker_disabled:
|
||||
hide_perspective_line()
|
||||
return
|
||||
default_color.a = 0.5
|
||||
|
@ -94,7 +94,7 @@ func try_rotate_scale():
|
|||
var test_line := (points[1] - points[0]).rotated(deg_to_rad(90)).normalized()
|
||||
var from_a := mouse_point - test_line * CIRCLE_RAD * 2 / Global.camera.zoom.x
|
||||
var from_b := mouse_point + test_line * CIRCLE_RAD * 2 / Global.camera.zoom.x
|
||||
if Input.is_action_just_pressed("left_mouse") and Global.can_draw and Global.has_focus:
|
||||
if Input.is_action_just_pressed("left_mouse") and Global.can_draw:
|
||||
if (
|
||||
Geometry2D.segment_intersects_segment(from_a, from_b, points[0], points[1])
|
||||
or mouse_point.distance_to(points[1]) < CIRCLE_RAD * 2 / Global.camera.zoom.x
|
||||
|
|
|
@ -75,7 +75,6 @@ func _input(_event: InputEvent):
|
|||
if (
|
||||
Input.is_action_just_pressed("left_mouse")
|
||||
and Global.can_draw
|
||||
and Global.has_focus
|
||||
and mouse_point.distance_to(start) < 8 / Global.camera.zoom.x
|
||||
):
|
||||
if (
|
||||
|
|
Loading…
Reference in a new issue