Bug 2729 - Negative dash offsets
Summary: Negative dash offsets
Status: RESOLVED FIXED
Alias: None
Product: cairo
Classification: Unclassified
Component: general (show other bugs)
Version: 0.9.3
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Carl Worth
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-14 14:33 UTC by Owen Taylor
Modified: 2005-08-22 00:14 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Test case (2.27 KB, text/plain)
2005-03-14 14:35 UTC, Owen Taylor
Details
Current output (189 bytes, image/png)
2005-03-14 14:35 UTC, Owen Taylor
Details
Test case and fix, ready for CVS. (12.62 KB, patch)
2005-08-19 10:53 UTC, Carl Worth
Details | Splinter Review

Description Owen Taylor 2005-03-14 14:33:57 UTC
Negative dash offsets work strangely ... instead of treating the 
dash pattern as infinitely repeating in both directions, patterns
of the pattern less than 0 are consider to be all on.

E.g. a 1,1 dash with an offset of 5 gives [6,1,1,1,1,1]

The test case attached also reveals something else that suprised me ..
a 1,1 dash offset by 50% gives a noticeably striated result. But
thinking about it, that's a consequence of the subsampling algorithm
The values are 120 and 135 out of 255 ... e.g, +/- a sample column.
Comment 1 Owen Taylor 2005-03-14 14:35:06 UTC
Created attachment 2106 [details]
Test case

Test case for test/
Comment 2 Owen Taylor 2005-03-14 14:35:39 UTC
Created attachment 2107 [details]
Current output
Comment 3 Carl Worth 2005-08-19 10:53:17 UTC
Created attachment 2930 [details] [review]
Test case and fix, ready for CVS.
Comment 4 Carl Worth 2005-08-19 12:02:19 UTC
2005-08-19  Carl Worth  <cworth@cworth.org>

        Fix for bug #2729:

        * src/cairo-gstate.c: (_cairo_gstate_set_dash): Adjust negative
        offsets up to their equivalent positive value. Add error checking
        for dash values, (must each be non-negative and must not be all
        zero).

        * src/cairo.c (cairo_set_dash): Add documentation.

        * src/cairo.h:
        * src/cairo.c: (cairo_status_to_string): Add new
        CAIRO_STATUS_INVALID_DASH.

        * test/.cvsignore:
        * test/Makefile.am: Add dash-offfset-negative test from Owen.

        * doc/public/tmpl/cairo.sgml: churn
Comment 5 Carl Worth 2005-08-22 17:14:35 UTC
Move bugs against "cvs" version to "0.9.3" so we can remove the "cvs" version.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.