From d398073d6172282659e91eeaa2d6452a3144ebc3 Mon Sep 17 00:00:00 2001 From: scuri Date: Wed, 12 May 2010 21:08:26 +0000 Subject: *** empty log message *** --- src/cairo/cdcairo.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) (limited to 'src/cairo/cdcairo.c') diff --git a/src/cairo/cdcairo.c b/src/cairo/cdcairo.c index 34fdef7..83cf088 100644 --- a/src/cairo/cdcairo.c +++ b/src/cairo/cdcairo.c @@ -14,14 +14,11 @@ #include "cdcairoctx.h" -#define HATCH_WIDTH 8 -#define HATCH_HEIGHT 8 #ifndef M_PI #define M_PI 3.14159265358979323846 #endif - static int StrIsAscii(const char* str) { while(*str) @@ -294,12 +291,12 @@ static void cdstipple(cdCtxCanvas *ctxcanvas, int n, int m, const unsigned char static int cdhatch(cdCtxCanvas *ctxcanvas, int style) { - int hsize = HATCH_WIDTH - 1; + int hsize = ctxcanvas->hatchboxsize; int hhalf = hsize / 2; cairo_surface_t* hatch_surface; cairo_t* cr; - hatch_surface = cairo_surface_create_similar(cairo_get_target(ctxcanvas->cr), CAIRO_CONTENT_COLOR_ALPHA, HATCH_WIDTH, HATCH_HEIGHT); + hatch_surface = cairo_surface_create_similar(cairo_get_target(ctxcanvas->cr), CAIRO_CONTENT_COLOR_ALPHA, hsize, hsize); cr = cairo_create(hatch_surface); @@ -366,21 +363,6 @@ static int cdhatch(cdCtxCanvas *ctxcanvas, int style) /* attributes */ /******************************************************/ -static int cdwritemode(cdCtxCanvas *ctxcanvas, int write_mode) -{ - switch (write_mode) - { - case CD_REPLACE: - cairo_set_operator (ctxcanvas->cr, CAIRO_OPERATOR_OVER); - break; - case CD_XOR: - cairo_set_operator (ctxcanvas->cr, CAIRO_OPERATOR_XOR); - break; - } - - return write_mode; -} - static int cdinteriorstyle (cdCtxCanvas* ctxcanvas, int style) { switch (style) @@ -1676,6 +1658,7 @@ cdCtxCanvas *cdcairoCreateCanvas(cdCanvas* canvas, cairo_t* cr) ctxcanvas->cr = cr; ctxcanvas->canvas = canvas; ctxcanvas->last_source = -1; + ctxcanvas->hatchboxsize = 8; canvas->ctxcanvas = ctxcanvas; canvas->invert_yaxis = 1; @@ -1735,7 +1718,6 @@ void cdcairoInitTable(cdCanvas* canvas) canvas->cxGetFontDim = cdgetfontdim; canvas->cxGetTextSize = cdgettextsize; canvas->cxTransform = cdtransform; - canvas->cxWriteMode = cdwritemode; canvas->cxForeground = cdforeground; canvas->cxGetImageRGB = cdgetimagergb; -- cgit v1.2.3