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

Fix formatting and make unused docstrings to comments of the previous commit

This commit is contained in:
Emmanouil Papadeas 2024-10-18 00:01:27 +03:00
parent 2cb29ab274
commit 370ae7525a
2 changed files with 6 additions and 4 deletions

View file

@ -7,7 +7,7 @@ var main_canvas := Global.control.find_child("Main Canvas", true, false)
func _ready() -> void: func _ready() -> void:
if main_canvas is FloatingWindow: ## If it's shifted to a window then get the content if main_canvas is FloatingWindow: # If it's shifted to a window then get the content.
main_canvas = main_canvas.window_content main_canvas = main_canvas.window_content
await get_tree().process_frame await get_tree().process_frame
Global.control.main_ui.sort_children.connect(_recalculate_opacity) Global.control.main_ui.sort_children.connect(_recalculate_opacity)
@ -30,13 +30,13 @@ func set_window_opacity(value: float) -> void:
value = 100.0 value = 100.0
slider.value = value slider.value = value
value = value / 100.0 value = value / 100.0
# Find the TabContainer that has the Main Canvas panel # Find the TabContainer that has the Main Canvas panel.
for container: Control in Global.control.main_ui._panel_container.get_children(): for container: Control in Global.control.main_ui._panel_container.get_children():
if container is TabContainer: if container is TabContainer:
var center := container.get_rect().get_center() var center := container.get_rect().get_center()
if main_canvas.get_rect().has_point(center): if main_canvas.get_rect().has_point(center):
if main_canvas.get_window() != get_tree().root: if main_canvas.get_window() != get_tree().root:
## In case we converted to window while trransparency was active # In case we converted to window while trransparency was active.
container.self_modulate.a = 1.0 container.self_modulate.a = 1.0
else: else:
container.self_modulate.a = value container.self_modulate.a = value

View file

@ -37,5 +37,7 @@ func update_transparent_shader() -> void:
# Works independently of the transparency feature # Works independently of the transparency feature
var canvas_size: Vector2 = (main_canvas_container.size - Vector2.DOWN * 2) * Global.shrink var canvas_size: Vector2 = (main_canvas_container.size - Vector2.DOWN * 2) * Global.shrink
transparency_material.set_shader_parameter("screen_resolution", get_viewport().size) transparency_material.set_shader_parameter("screen_resolution", get_viewport().size)
transparency_material.set_shader_parameter("position", main_canvas_container.global_position * Global.shrink) transparency_material.set_shader_parameter(
"position", main_canvas_container.global_position * Global.shrink
)
transparency_material.set_shader_parameter("size", canvas_size) transparency_material.set_shader_parameter("size", canvas_size)