Print at Dec 17, 2025, 9:01:56 PM

Posted by Walter125 at Oct 14, 2023, 11:42:46 AM
Bug found in HomefurniturePanel.java
Hi,

I'm using linux version of SweetHome3D.

When I try to modify a furniture, for example open the door of a kitchen cabinet, the most of time, the 3D view of the cabinet isn't shown, and so, I can't open the door.

After several clicks on the button to reloads of the ModelTransformationsPanel, the 3D view of the model is finally shown.

The bug doesn't appear when I compile SweetHome3D with the following modification, arround line 2111 in HomefurniturePanel.java:

private void layoutComponents() {
int standardGap = Math.round(5 * SwingTools.getResolutionScale());
// Preview

// BUG Here ?
/*
add(this.transformationsLabel, new GridBagConstraints(
0, 0, 2, 1, 0, 0, GridBagConstraints.LINE_START,
GridBagConstraints.NONE, new Insets(0, 0, standardGap, 10), 0, 0));
*/

this.previewComponent.setPreferredSize(new Dimension(400, 400));
add(this.previewComponent, new GridBagConstraints(
0, 1, 1, 10, 0, 0, GridBagConstraints.NORTH,
GridBagConstraints.NONE, new Insets(0, 2, 0, 15), 0, 0));
add(this.resetTransformationsButton, new GridBagConstraints(
1, 1, 1, 1, 0, 0, GridBagConstraints.NORTH,
GridBagConstraints.BOTH, new Insets(0, 2, standardGap, 0), 0, 0));


I have commented the lines adding a label to the grid. With this modification, the 3D view of the model is shown each time I open the transformations panel.

But I'm not used to program grid layouts, so I don't know how to correct this bug.

At a first look, the grid layouts of all the objects seem to me to be correct.