diff options
Diffstat (limited to 'editor/plugins/texture_layered_editor_plugin.cpp')
| -rw-r--r-- | editor/plugins/texture_layered_editor_plugin.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/editor/plugins/texture_layered_editor_plugin.cpp b/editor/plugins/texture_layered_editor_plugin.cpp index 20e7b5d8c4..b74a762444 100644 --- a/editor/plugins/texture_layered_editor_plugin.cpp +++ b/editor/plugins/texture_layered_editor_plugin.cpp @@ -219,25 +219,23 @@ void TextureLayeredEditor::edit(Ref<TextureLayered> p_texture) { TextureLayeredEditor::TextureLayeredEditor() { set_texture_repeat(TextureRepeat::TEXTURE_REPEAT_ENABLED); set_custom_minimum_size(Size2(1, 150)); + texture_rect = memnew(Control); - texture_rect->connect("draw", callable_mp(this, &TextureLayeredEditor::_texture_rect_draw)); texture_rect->set_mouse_filter(MOUSE_FILTER_IGNORE); add_child(texture_rect); + texture_rect->connect("draw", callable_mp(this, &TextureLayeredEditor::_texture_rect_draw)); layer = memnew(SpinBox); layer->set_step(1); layer->set_max(100); + layer->set_h_grow_direction(GROW_DIRECTION_BEGIN); + layer->set_modulate(Color(1, 1, 1, 0.8)); add_child(layer); layer->set_anchor(SIDE_RIGHT, 1); layer->set_anchor(SIDE_LEFT, 1); - layer->set_h_grow_direction(GROW_DIRECTION_BEGIN); - layer->set_modulate(Color(1, 1, 1, 0.8)); + layer->connect("value_changed", callable_mp(this, &TextureLayeredEditor::_layer_changed)); + info = memnew(Label); - add_child(info); - info->set_anchor(SIDE_RIGHT, 1); - info->set_anchor(SIDE_LEFT, 1); - info->set_anchor(SIDE_BOTTOM, 1); - info->set_anchor(SIDE_TOP, 1); info->set_h_grow_direction(GROW_DIRECTION_BEGIN); info->set_v_grow_direction(GROW_DIRECTION_BEGIN); info->add_theme_color_override("font_color", Color(1, 1, 1, 1)); @@ -245,9 +243,11 @@ TextureLayeredEditor::TextureLayeredEditor() { info->add_theme_constant_override("shadow_outline_size", 1); info->add_theme_constant_override("shadow_offset_x", 2); info->add_theme_constant_override("shadow_offset_y", 2); - - setting = false; - layer->connect("value_changed", callable_mp(this, &TextureLayeredEditor::_layer_changed)); + add_child(info); + info->set_anchor(SIDE_RIGHT, 1); + info->set_anchor(SIDE_LEFT, 1); + info->set_anchor(SIDE_BOTTOM, 1); + info->set_anchor(SIDE_TOP, 1); } TextureLayeredEditor::~TextureLayeredEditor() { |
