|
Sweet Home 3D Forum » List all forums » » Forum: Developers » » » Thread: Bug found in HomefurniturePanel.java |
|
| Print at Jan 21, 2026, 2:50:02 AM | View all posts in this thread on one page |
| Posted by Walter125 at Oct 14, 2023, 1:42:46 PM |
|
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() {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. |
| Posted by Keet at Oct 14, 2023, 2:03:33 PM |
|
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 1300+ 3D models, manuals, and projects |
| Posted by Daniels118 at Oct 15, 2023, 11:06:27 AM |
|
Re: Bug found in HomefurniturePanel.java You may report the bug here: https://sourceforge.net/p/sweethome3d/bugs/ It will help the developer to keep track of problems that must be solved (the forum post could be forgotten after a while). |
| Posted by Puybaret at Oct 15, 2023, 5:43:31 PM |
|
Re: Bug found in HomefurniturePanel.java This looks like the bug #1184. ---------------------------------------- Emmanuel Puybaret, Sweet Home 3D creator |
| Posted by Keet at Oct 15, 2023, 6:35:19 PM |
|
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 1300+ 3D models, manuals, and projects |
| Posted by Walter125 at Oct 15, 2023, 8:38:15 PM |
|
Re: Bug found in HomefurniturePanel.java I think it is a bug internal to the java linux implementation. It seems I have found a workarround, adding the following line before to add the Label to the grid at line 2111: this.transformationsLabel.setPreferredSize(this.transformationsLabel.getPreferredSize());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 ? Example of scaling: float scale = SwingTools.getResolutionScale();instead of actually: this.previewComponent.setPreferredSize(new Dimension(400, 400)); |
| Posted by Walter125 at Oct 15, 2023, 8:47:41 PM |
|
Re: Bug found in HomefurniturePanel.java I just noticed the previewComponent is already scaled in the function createComponents, so the line 2114 that rescale it, should be removed ? |
| Posted by Puybaret at Oct 16, 2023, 6:43:04 PM |
|
Re: Bug found in HomefurniturePanel.java Adding the line this.transformationsLabel.setPreferredSize(this.transformationsLabel.getPreferredSize());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 |
| Posted by Walter125 at Oct 16, 2023, 8:28:56 PM |
|
Re: Bug found in HomefurniturePanel.java Following your suggestion, I tried to add 1 pixel only to the height, it also works. With the following code: Dimension size = this.transformationsLabel.getPreferredSize();I tried to add 1 pixel only to the width, and 1 pixel both to the width and the height. It worked in all these cases. About the line I suggested, I don't know why but it works on my system. I precise that like Keet, I'm using Debian. |
|
|
Current timezone is GMT Jan 21, 2026, 2:50:02 AM |