JDK-8118545 : Split Panes seem to come with 1 pixel padding
  • Type: Bug
  • Component: javafx
  • Sub-Component: controls
  • Affected Version: fx2.1
  • Priority: P3
  • Status: Resolved
  • Resolution: Duplicate
  • Submitted: 2012-01-12
  • Updated: 2015-06-17
  • Resolved: 2012-03-09
Related Reports
Relates :  
Relates :  
Description
See attached screenshot. If you add "-fx-padding: 0;" to the splitPane then the problem is solved.

Why are splitPanes coming out of the library with 1 pixel of padding?

I believe this is also the cause of DTL-3694
Comments
This is caused by RT-20229
09-03-2012

Splitpane contains by default a 1px padding. This is set in the caspian rule. 2 pointes there: 1) This padding is not displayed when there is no border color. Shouldn't it be? 2) Why do we have a 1px padding by default for a SplitPane? Shouldn't it come with a 0px padding?
08-03-2012

Using SB CSS Panel we clearly see that a caspian SplitPane comes with a 1px padding. This 1px padding is not graphically displayed until there is a border. Without border, padding must be minimum 2px to be displayed. Sizing computation seems to be wrong somwhere. I am going to move it as a platform issue.
08-03-2012

This is really strange: if you don't set a -fx-border-color IN THE FXML on the split pane, there is no padding. The attached project shows the problem: if you run it as it stands, you will see the padding. If you remove the style="-fx-border-color: red" attribute from the SplitPane in the FXML, the padding disappears: even if you click on the "Change Style" button, the splitpane border becomes red but the padding does not appear. Strange indeed. I think I will affect it to Jef for further investigation, as there seems to be some funny business with changing the style property dynamically... Reseting the style dynamically to "" has no effect. So it's difficult to see whether the padding should have always been there in the first place, or whether it's a side effect of the initialization (like: if you set the style before the node is displayed you get the padding, but if you set it after it is displayed you don't get it). Jef can you see whether the padding is really intended - in which case it is a configuration/caspian issue and we could ask it to be removed from caspian, or whether it is not intended but produced by a side effect, in which case it is a bug in the CSS engine and we could ask for that bug to be fixed?
07-03-2012

Eric, if you confirm this indeed does not come from SB initialization of the component, could you please just transform this into a platform (RT) bug? [use More Actions > Move command).
07-03-2012

I still think my comment above applies (Jan, 13 2012 11:50 AM). I don't think a container should offset it's children by default.
06-03-2012

If we still consider this behavior as an issue, then we should file a bug against the platform. SB cannot do anything here. Mo, I re-assign to you so that you can review and decide.
06-03-2012

I think it is an issue as the content of a split pane is offset by 1 pixel. I would argue that a container should not offset it's content by any amount. If the user wanted padding then they should add it - they should not have to remove it each time when they don't want it...
13-01-2012

SB does not force any padding on SplitPane. So I guess this is the default setup by the platform. Since it is possible to change that using CSS, is it really an issue ?
13-01-2012