Skip to content

[FORGED] [R] R cairo_pdf function does not respect plotting boundaries

3 messages · Paul Murrell, Lee Steven Kelvin

#
Hi

(cc'ed to r-devel where further discussion should probably take place)

Thanks Lee.  I see that problem.

There is a "+ 1" in the Cairo device code for setting the clipping region
(https://github.com/wch/r-source/blob/ba600867f2a94e46cf9eb75dc8b37f12b08a4561/src/library/grDevices/src/cairo/cairoFns.c#L156) 


Remove the "+ 1" and the problem goes away (for your example at least).

The comment on the line above that code suggests that the "+ 1" was 
modelled on the X11 device code, but X11 deals in integer pixels and 
Cairo (at the API level) does not, so it would seem that the "+ 1" is 
just unnecessary.

However, I have a slight nagging worry that we have been here before, so 
I would like to do some more testing before committing that change.

Paul
On 1/03/19 8:13 AM, Lee Steven Kelvin wrote:

  
    
#
Hi Paul,

Great, thank you for looking in to this, and I'm glad that you're able to reproduce it at your end too.
7 days later
#
Hi

I have committed this fix to r-devel (r76226).

Please let me know if this does not fix things for you.

Paul
On 5/03/19 8:22 PM, Lee Steven Kelvin wrote: