[Rd] Question about grid.group compositing operators in cairo

Paul Murrell p@u| @end|ng |rom @t@t@@uck|@nd@@c@nz
Tue Sep 27 04:44:39 CEST 2022


Could you also please send me the SVG code that your device is 
generating for your example.  Thanks!

Paul

On 27/09/22 08:50, Paul Murrell wrote:
> Hi
> 
> Thanks for the report.  It certainly sounds like I have done something 
> stupid :)  For my debugging and testing could you please share the R 
> code from your tests ?  Thanks!
> 
> Paul
> 
> On 26/09/22 10:27, Panagiotis Skintzos wrote:
>> Hello,
>>
>> I'm trying to update ggiraph package in graphic engine v15 (currently 
>> we support up to v14).
>>
>> I've implemented the group operators and when I compare the outputs of 
>> ggiraph::dsvg with the outputs of svg/png, I noticed some weird results.
>>
>> Specifically, some operators in cairo (in, out, dest.in, dest.atop) 
>> give strange output, when any source element in the group has a stroke 
>> color defined.
>>
>> I attach three example images, where two stroked rectangles are used 
>> as source (right) and destination (left).
>>
>> cairo.over.png shows the result of the over operator in cairo
>>
>> cairo.in.png shows the result of the in operator in cairo
>>
>> dsvg.in.png shows the result of the in operator in dsvg
>>
>>
>> You can see the difference between cairo.in.png and dsvg.in.png. I 
>> found out why I get different results:
>>
>> In dsvg implementation there is one drawing operation: Draw the source 
>> element, as whole (fill and stroke) over the destination element 
>> (using feComposite filter)
>>
>> In cairo implementation though there are two operations: Apply the 
>> fill on source and draw over the destination and then apply the stroke 
>> and draw over the result of the previous operation.
>>
>> I'm not sure if this is intentional or not. Shouldn't the source 
>> element being drawn first as whole (fill and stroke with over 
>> operator) and then apply the group operator and draw it over the 
>> destination? It would seem more logical that way.
>>
>>
>> Thanks,
>>
>> Panagiotis
>>
>>
>> ______________________________________________
>> R-devel using r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel 
>>
> 

-- 
Dr Paul Murrell
Te Kura Tatauranga | Department of Statistics
Waipapa Taumata Rau | The University of Auckland
Private Bag 92019, Auckland 1142, New Zealand
64 9 3737599 x85392
paul using stat.auckland.ac.nz
www.stat.auckland.ac.nz/~paul/



More information about the R-devel mailing list