From 0a2cbbd7a7eb1193c361eb4c8bafe9880b551219 Mon Sep 17 00:00:00 2001 From: buliabyak Date: Mon, 19 Mar 2007 03:05:11 +0000 Subject: [PATCH] switch to using NR::Maybe for area rect --- src/display/inkscape-cairo.cpp | 8 +++++--- src/display/inkscape-cairo.h | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/display/inkscape-cairo.cpp b/src/display/inkscape-cairo.cpp index 9a8500885..5d87d39b2 100644 --- a/src/display/inkscape-cairo.cpp +++ b/src/display/inkscape-cairo.cpp @@ -46,11 +46,13 @@ nr_create_cairo_context (NRRectL *area, NRPixBlock *pb) /** Feeds path-creating calls to the cairo context translating them from the SPCurve, with the given transform and shift */ void -feed_curve_to_cairo (cairo_t *ct, NArtBpath *bpath, NR::Matrix trans, NR::Rect area, bool optimize_stroke, double stroke_width) +feed_curve_to_cairo (cairo_t *ct, NArtBpath *bpath, NR::Matrix trans, NR::Maybe area, bool optimize_stroke, double stroke_width) { NR::Point next(0,0), last(0,0); - NR::Point shift = area.min(); - NR::Rect view = area; + if (!area || area->isEmpty()) + return; + NR::Point shift = area->min(); + NR::Rect view = *area; view.growBy (stroke_width); NR::Rect swept; bool closed = false; diff --git a/src/display/inkscape-cairo.h b/src/display/inkscape-cairo.h index 4b9f50e76..fa579fb20 100644 --- a/src/display/inkscape-cairo.h +++ b/src/display/inkscape-cairo.h @@ -11,7 +11,7 @@ */ cairo_t *nr_create_cairo_context (NRRectL *area, NRPixBlock *pb); -void feed_curve_to_cairo (cairo_t *ct, NArtBpath *bpath, NR::Matrix trans, NR::Rect area, bool optimize_stroke, double stroke_width); +void feed_curve_to_cairo (cairo_t *ct, NArtBpath *bpath, NR::Matrix trans, NR::Maybe area, bool optimize_stroke, double stroke_width); #endif /* -- 2.30.2