Bug 14511 - PDF_SetLineColor colormodel
Summary: PDF_SetLineColor colormodel
Alias: None
Product: R
Classification: Unclassified
Component: Graphics (show other bugs)
Version: R 2.12.1 patched
Hardware: All All
: P5 minor
Assignee: R-core
Depends on:
Reported: 2011-02-23 23:34 UTC by Philip Johnson
Modified: 2015-12-14 13:46 UTC (History)
0 users

See Also:

patch to add curly braces (594 bytes, application/octet-stream)
2011-02-23 23:34 UTC, Philip Johnson

Note You need to log in before you can comment on or make changes to this bug.
Description Philip Johnson 2011-02-23 23:34:52 UTC
Created attachment 1177 [details]
patch to add curly braces

High-level symptom:
   Creating a PDF under the "gray" colormodel converts fill colors to gray, but strokes remain colorful.

in src/library/grDevices/src/devPS.c

The function PDF_SetLineColor checks if colormodel gray or cmyk and otherwise assumes rgb.  The final "else" appears to be missing curly braces, which results in the rgb color being set in the PDF command stream regardless of the colormodel.  Indenting and the existence of braces in the analogous PDF_SetFill function implies that this is bug rather than a feature.

Patch attached relative to this R-devel:
Revision: 54548
Last Changed Date: 2011-02-22
Comment 1 Simon Urbanek 2011-02-25 04:10:14 UTC
Thanks, now fixed in R-devel (r54576)