Syntax for image-pattern support in CSS

Richard Bair richard.bair at oracle.com
Thu Aug 30 18:20:27 PDT 2012


http://javafx-jira.kenai.com/browse/RT-19455

Anywhere a Paint is allowed:

url('region/test20x20.png');
image-pattern('region/test20x20.png', 0, 0, 1, 1, true);

The syntax is exactly the same as our ImagePattern class. I rather chose the rgb() style function rather than linear, radial gradient style named parameters both because it was less work and less syntax to define, and because there aren't many params and I thought I'd just map directly to the class. I could have tried giving percentage based value support (percent of what? The image, the dest?) but I decided to just stick with plain numbers. Most of the time people will either just use the url version and get tiling for free, or they will use the image-pattern version and get it stretched (as I've done here). Or they can do whatever with the image-pattern version.

What do you think?

(I'm attacking this issue right now, incidentally, because I'm working on numerous Region performance and behavior issues, and in my travels I noticed some very useful rendering modes are not supported currently with respect to images, so I thought I would round it all out while I was in the code).

Richard


More information about the openjfx-dev mailing list