Update pdfioContentSetDashPattern to accept doubles (Issue #25)

This commit is contained in:
Michael R Sweet 2021-10-16 09:41:19 -04:00
parent 095a4c10d4
commit 22c245ffd1
3 changed files with 6 additions and 5 deletions

View File

@ -9,6 +9,7 @@ v1.0.0 (TBD)
(Issue #21)
- Fixed `all-shared` target (Issue #22)
- Fixed memory leaks (Issue #23)
- Updated `pdfioContentSetDashPattern` to accept `double` values (Issue #25)
- Fixed some issues identified by a Coverity scan.

View File

@ -660,11 +660,11 @@ pdfioContentSave(pdfio_stream_t *st) // I - Stream
bool // O - `true` on success, `false` on failure
pdfioContentSetDashPattern(
pdfio_stream_t *st, // I - Stream
int phase, // I - Phase (offset within pattern)
int on, // I - On length
int off) // I - Off length
double phase, // I - Phase (offset within pattern)
double on, // I - On length
double off) // I - Off length
{
return (pdfioStreamPrintf(st, "[%d %d] %d d\n", on, off, phase));
return (pdfioStreamPrintf(st, "[%g %g] %g d\n", on, off, phase));
}

View File

@ -96,7 +96,7 @@ extern bool pdfioContentPathMoveTo(pdfio_stream_t *st, double x, double y) _PDF
extern bool pdfioContentPathRect(pdfio_stream_t *st, double x, double y, double width, double height) _PDFIO_PUBLIC;
extern bool pdfioContentRestore(pdfio_stream_t *st) _PDFIO_PUBLIC;
extern bool pdfioContentSave(pdfio_stream_t *st) _PDFIO_PUBLIC;
extern bool pdfioContentSetDashPattern(pdfio_stream_t *st, int phase, int on, int off) _PDFIO_PUBLIC;
extern bool pdfioContentSetDashPattern(pdfio_stream_t *st, double phase, double on, double off) _PDFIO_PUBLIC;
extern bool pdfioContentSetFillColorDeviceCMYK(pdfio_stream_t *st, double c, double m, double y, double k) _PDFIO_PUBLIC;
extern bool pdfioContentSetFillColorDeviceGray(pdfio_stream_t *st, double g) _PDFIO_PUBLIC;
extern bool pdfioContentSetFillColorDeviceRGB(pdfio_stream_t *st, double r, double g, double b) _PDFIO_PUBLIC;