Syntax for image-pattern support in CSS

joe andresen joseph.andresen at oracle.com
Fri Aug 31 09:15:15 PDT 2012


In thinking about this further, as long as we do exactly the same thing 
as gradients it should be fine (since gradients have the same issue with 
ranges as well).

PS. I was not suggesting that non proportional image patterns had 
percentages, just simply that the range was different.

I honestly think we can disregard this because we do the same thing for 
gradients already.

-J
> On Aug 30, 2012, at 10:27 PM, Richard Bair wrote:
>
>> 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).
>>
>> Richard
>>
>> 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.
>>>
>>> -J
>>>
>>> ----- Original Message -----
>>> From: richard.bair at oracle.com <mailto:richard.bair at oracle.com>
>>> To: openjfx-dev at openjdk.java.net <mailto: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
>>
>
> <http://www.oracle.com>
> David Grieve | Principal Member of Technical Staff
> Mobile: +16033121013 <tel:+16033121013>
> Oracle Java Client UI and Tools
> Durham, NH 03824
> <http://www.oracle.com/commitment> Oracle is committed to developing 
> practices and products that help protect the environment
>



More information about the openjfx-dev mailing list