mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-31 07:29:49 +00:00
Properly fix the palette panel initialization issue
And remove the hacky way. The issue is that the swatches were being created and then queue_freed at the end of the frame and not immediately.
This commit is contained in:
parent
f96879012d
commit
ad9d8cfdbc
|
@ -72,12 +72,6 @@ func _ready() -> void:
|
|||
|
||||
_show_splash_screen()
|
||||
|
||||
# Hacky way to update the panel's size... Unsure why this happens.
|
||||
yield(get_tree(), "idle_frame")
|
||||
ui.set_control_hidden(Global.palette_panel, true)
|
||||
yield(get_tree(), "idle_frame")
|
||||
ui.set_control_hidden(Global.palette_panel, false)
|
||||
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
Global.left_cursor.position = get_global_mouse_position() + Vector2(-32, 32)
|
||||
|
|
|
@ -94,6 +94,7 @@ func scroll_palette(origin: Vector2) -> void:
|
|||
func clear_swatches() -> void:
|
||||
swatches.clear()
|
||||
for swatch in get_children():
|
||||
remove_child(swatch) # To remove the child immediately and not at the end of the frame
|
||||
swatch.queue_free()
|
||||
|
||||
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
[ext_resource path="res://src/Palette/PalettePanel.gd" type="Script" id=8]
|
||||
|
||||
[node name="PalettePanel" type="PanelContainer"]
|
||||
margin_right = 300.0
|
||||
margin_bottom = 319.0
|
||||
margin_right = 318.0
|
||||
margin_bottom = 118.0
|
||||
rect_min_size = Vector2( 318, 0 )
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 0
|
||||
|
@ -23,7 +23,7 @@ __meta__ = {
|
|||
margin_left = 7.0
|
||||
margin_top = 7.0
|
||||
margin_right = 311.0
|
||||
margin_bottom = 312.0
|
||||
margin_bottom = 111.0
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="PalettesLabel" type="Label" parent="PaletteVBoxContainer"]
|
||||
|
|
Loading…
Reference in a new issue