Syntax for image-pattern support in CSS
richard.bair at oracle.com
Thu Aug 30 19:27:11 PDT 2012
That's a good question, I really don't know how those properties work. Are they relative to the shape being filled, or are they relative to the source image? If the latter, then it is up to the developer. If it is the former, then I will need to change the parser to support percentages, in which case, I'm royally hosed (because although the parser can handle it fine, I have to pass the knowledge that these things are percentages down, and there is nothing to pass them down to).
On Aug 30, 2012, at 7:24 PM, Joe Andresen wrote:
> 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.
> ----- 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
> Anywhere a Paint is allowed:
> 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).
More information about the openjfx-dev