Merge pull request #80968 from rakkarage/alternative-icon-scale

Call `add_child` after `set_rect` to fix size bug
This commit is contained in:
Yuri Sizov 2023-08-25 21:26:50 +02:00
commit 6da4ad1662
1 changed files with 1 additions and 1 deletions

View File

@ -990,7 +990,6 @@ void TileSetAtlasSourceEditor::_update_atlas_view() {
// Create and position the button.
Button *button = memnew(Button);
alternative_tiles_control->add_child(button);
button->set_flat(true);
button->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons")));
button->add_theme_style_override("normal", memnew(StyleBoxEmpty));
@ -1000,6 +999,7 @@ void TileSetAtlasSourceEditor::_update_atlas_view() {
button->connect("pressed", callable_mp(tile_set_atlas_source, &TileSetAtlasSource::create_alternative_tile).bind(tile_id, TileSetSource::INVALID_TILE_ALTERNATIVE));
button->set_rect(Rect2(Vector2(pos.x, pos.y + (y_increment - texture_region_base_size.y) / 2.0), Vector2(texture_region_base_size_min, texture_region_base_size_min)));
button->set_expand_icon(true);
alternative_tiles_control->add_child(button);
pos.y += y_increment;
}