Joined: Sep 11, 2023
Post Count: 25
Status:
Offline
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:
// 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.
Netherlands
Joined: Apr 8, 2022
Post Count: 1291
Status:
Offline
Re: Bug found in HomefurniturePanel.java
I've had the same but always thought is was the momentary lack of resources on my system. If it's really this bug I'm sure Emmanuel will have it solved pretty fast.
---------------------------------------- Dodecagon.nl 950+ 3D models, manuals, and projects
Netherlands
Joined: Apr 8, 2022
Post Count: 1291
Status:
Offline
Re: Bug found in HomefurniturePanel.java
It does look like bug #1184. But I doubt it's a system update problem. I run into it every now and then on three different systems. Although all three are Debian (one host, two VM) they are different versions. The same problem persists on all three before and after system updates. Sometimes it helps to close Sweet Home 3D and restart it, other times I just keep on trying and after multiple tries it suddenly works. It's as if the 3D view to display the model can't be painted. In rare cases just modifying a color and then trying the deformations works, as if the model wasn't fully loaded before and changing a color loaded it correctly for 3D display. The main problem is that it isn't consistent, not even with the exact same model. This makes it very hard to determine what exactly is causing this. As far as I remember this happens with all versions of Sweet Home 3D, at least for the last 1-2 years.
---------------------------------------- Dodecagon.nl 950+ 3D models, manuals, and projects
I haven't a good knowledge of the program, but I also wonder if the size of the previewComponent should be scaled by in order to be adapted to the screen resolution, at line 2114 ?
should have no effect, since without this line the layout will try to set the label to its preferred size. The problem looks like the preferred size is actually different when the container is laid out and when it's displayed. Maybe forcing the preferred size to a larger size could fix the problem (a few pixels along width or height) without breaking container layout in Java implementations where it works now. Can you try?
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator