[cairo-bugs] [Bug 13411] New: pattern and dashes incompatible!
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Tue Nov 27 11:36:28 PST 2007
http://bugs.freedesktop.org/show_bug.cgi?id=13411
Summary: pattern and dashes incompatible!
Product: cairo
Version: 1.4.10
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: high
Component: postscript backend
AssignedTo: cworth at cworth.org
ReportedBy: doutriaux1 at llnl.gov
QAContact: cairo-bugs at cairographics.org
when using dashes and patterns the putput "freaks" out for lines!
This is postscript only, cairo works great with png for example
I'm pasting a small C example, turn on/off any of do32, dodashes or dopattern
ude <cairo.h>
#include <cairo-ps.h>
int main() {
cairo_surface_t *surface=NULL;
cairo_t *cr=NULL;
cairo_pattern_t *pattern=NULL;
cairo_surface_t *image=NULL;
cairo_t *cr2=NULL;
double dashes[4] ;
int ndashes;
double offset=0.;
dashes[0]=8.;
dashes[1]=4.;
dashes[2]=4.;
dashes[3]=4.;
ndashes = 4;
int dodash = 1;
int dopattern = 1;
int do32=1;
surface = cairo_ps_surface_create("crap.ps",611,792);
cairo_ps_surface_dsc_begin_setup (surface);
cairo_ps_surface_dsc_begin_page_setup (surface);
cr = cairo_create (surface);
cairo_set_line_cap (cr,CAIRO_LINE_CAP_ROUND);
cairo_set_source_rgb (cr, 0.000000,1.000000,0.000000);
if (dopattern) {
if (do32) image = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,4,4);
else image = cairo_image_surface_create(CAIRO_FORMAT_RGB24,4,4);
cr2 = cairo_create (image);
cairo_set_source(cr2,cairo_get_source(cr));
cairo_move_to(cr2,0,0);
cairo_line_to(cr2,0,3);
cairo_line_to(cr2,3,3);
cairo_fill(cr2);
pattern = cairo_pattern_create_for_surface (image);
cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT);
cairo_set_source(cr,pattern);
}
cairo_move_to(cr,136.372589,619.799988);
cairo_line_to(cr,136.372589,172.199997);
cairo_line_to(cr,491.490326,172.199997);
cairo_line_to(cr,491.490326,619.799988);
cairo_line_to(cr,136.372589,619.799988);
cairo_fill(cr);
cairo_set_source_rgb (cr, 0.000000,0.000000,0.000000);
if (dodash) { cairo_set_dash(cr,dashes,ndashes,0.);}
cairo_move_to(cr,136.372589,470.600006);
cairo_line_to(cr,491.490326,172.199997);
cairo_line_to(cr,550.676575,396.000000);
cairo_line_to(cr,77.186295,396.000000);
cairo_stroke(cr);
cairo_show_page(cr);
cairo_surface_flush(surface);
cairo_surface_finish(surface);
cairo_surface_destroy (surface);
cairo_destroy (cr);
}
--
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.
More information about the cairo-bugs
mailing list