Syntax for image-pattern support in CSS

Joe Andresen joseph.andresen at oracle.com
Thu Aug 30 19:24:12 PDT 2012


Hey Rich,

Looks good to me.

If proportional is false, the range of the previous parameters will change. Will this be alright with the way we represent ranges in CSS? I'm assuming yes.

-J

----- Original Message -----
From: richard.bair at oracle.com
To: openjfx-dev at openjdk.java.net
Sent: Thursday, August 30, 2012 6:36:19 PM GMT -08:00 US/Canada Pacific
Subject: Syntax for image-pattern support in CSS

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