I am trying to use a simple image as background image for an HBox through repetition, but I have found a problem. The HBox has got rounded borders (using fx-background-radius) and when I set the background image with fx-background-image it does not fit the real borders of the HBox and it appears painted outside the limits.
The css code is the following:
-fx-background-radius: 0 0 30 30;
-fx-background-image:url('image1.png');
-fx-border-radius: 0 0 30 30;
-fx-border-width:0 2 2 2;
-fx-border-color:#D9D9D9 #D9D9D9 #D9D9D9 #D9D9D9;
-fx-effect: dropshadow( two-pass-box , rgba(0,0,0,0.35) , 20.13095238095238,0.5 , 0 , 18 );
Maybe this is the expected behaviour, but I consider a useful improvement that the background-image can be adjusted to the real geometry of the background and the visible part of the component itself.
Thanks.
The css code is the following:
-fx-background-radius: 0 0 30 30;
-fx-background-image:url('image1.png');
-fx-border-radius: 0 0 30 30;
-fx-border-width:0 2 2 2;
-fx-border-color:#D9D9D9 #D9D9D9 #D9D9D9 #D9D9D9;
-fx-effect: dropshadow( two-pass-box , rgba(0,0,0,0.35) , 20.13095238095238,0.5 , 0 , 18 );
Maybe this is the expected behaviour, but I consider a useful improvement that the background-image can be adjusted to the real geometry of the background and the visible part of the component itself.
Thanks.
- relates to
-
JDK-8101830 Textured paints via css
-
- Resolved
-