index 49d47ec77bda5369b3c694749b93d74b954fa7dd..b67ac1311cb703d229ff472e768a30cb5c738872 100644 (file)
/** Creates a cairo context to render to the given SPCanvasBuf on the given area */
cairo_t *
-nr_create_cairo_context_canvasbuf (NRRectL *area, SPCanvasBuf *b)
+nr_create_cairo_context_canvasbuf (NRRectL */*area*/, SPCanvasBuf *b)
{
return nr_create_cairo_context_for_data (&(b->rect), &(b->rect), b->buf, b->buf_rowstride);
}
@@ -159,13 +159,15 @@ feed_curve_to_cairo (cairo_t *ct, NArtBpath const *bpath, NR::Matrix trans, NR::
static void
feed_curve_to_cairo(cairo_t *cr, Geom::Curve const &c, Geom::Matrix & trans, Geom::Rect view, bool optimize_stroke)
{
- if(Geom::LineSegment const* line_segment = dynamic_cast<Geom::LineSegment const*>(&c)) {
- // same logic can be used for hlinesegment and vlinesegment: just use finalpoint
- Geom::Point end_tr = (*line_segment)[1] * trans;
+ if( dynamic_cast<Geom::LineSegment const*>(&c) ||
+ dynamic_cast<Geom::HLineSegment const*>(&c) ||
+ dynamic_cast<Geom::VLineSegment const*>(&c) )
+ {
+ Geom::Point end_tr = c.finalPoint() * trans;
if (!optimize_stroke) {
cairo_line_to(cr, end_tr[0], end_tr[1]);
} else {
- Geom::Rect swept((*line_segment)[0]*trans, end_tr);
+ Geom::Rect swept(c.initialPoint()*trans, end_tr);
if (swept.intersects(view)) {
cairo_line_to(cr, end_tr[0], end_tr[1]);
} else {