raeleus/skin-composer

Wrong java code generated by SplitPane in scene composer

Closed this issue · 2 comments

Version: 46

Code generated with SplitPane will duplicate the first pane part twice and miss the second pane.

See example below:

UI display on scene composer:
QQ20220219-191408@2x

Code generated:

// impots...
public class Core extends ApplicationAdapter {
    private Skin skin;

    private Stage stage;

    public void create() {
        stage = new Stage(new ScreenViewport());
        skin = new Skin(Gdx.files.internal("skin.json"));
        Gdx.input.setInputProcessor(stage);

        Table table = new Table();
        table.setFillParent(true);


        Label label = new Label("first pane", skin);

        label = new Label("first pane", skin);
        SplitPane splitPane = new SplitPane(label, label, false, skin);
        table.add(splitPane);
        stage.addActor(table);
    }

    // remaining codes
}

It looks a wrong child is passed on this line:

WidgetNamePair pair2 = createWidget(splitPane.childFirst, variables, usedVariables, classNameGetter);

Oh my! What a big screw up. I'll make an update soon. Thanks for your research on this.