From d331e75a28fc513289d24bc0dc10ef7be26da888 Mon Sep 17 00:00:00 2001 From: Niko Kiirala Date: Wed, 21 Jun 2006 16:04:22 +0000 Subject: svg-filters branch merged back to head (bzr r1252) --- src/libnr/nr-rect.cpp | 11 +++++++++++ src/libnr/nr-rect.h | 1 + 2 files changed, 12 insertions(+) (limited to 'src/libnr') diff --git a/src/libnr/nr-rect.cpp b/src/libnr/nr-rect.cpp index 0a8287bde..6d881e7b0 100644 --- a/src/libnr/nr-rect.cpp +++ b/src/libnr/nr-rect.cpp @@ -150,6 +150,17 @@ nr_rect_d_matrix_transform(NRRect *d, NRRect const *s, NRMatrix const *m) return nr_rect_d_matrix_transform(d, s, *m); } +/** Enlarges the rectangle given amount of pixels to all directions */ +NRRectL * +nr_rect_l_enlarge(NRRectL *d, int amount) +{ + d->x0 -= amount; + d->y0 -= amount; + d->x1 += amount; + d->y1 += amount; + return d; +} + namespace NR { Rect::Rect(const Point &p0, const Point &p1) diff --git a/src/libnr/nr-rect.h b/src/libnr/nr-rect.h index 767eab902..ab78c1651 100644 --- a/src/libnr/nr-rect.h +++ b/src/libnr/nr-rect.h @@ -69,6 +69,7 @@ NRRectL *nr_rect_l_union_xy(NRRectL *d, NR::ICoord x, NR::ICoord y); NRRect *nr_rect_d_matrix_transform(NRRect *d, NRRect const *s, NR::Matrix const &m); NRRect *nr_rect_d_matrix_transform(NRRect *d, NRRect const *s, NRMatrix const *m); +NRRectL *nr_rect_l_enlarge(NRRectL *d, int amount); namespace NR { -- cgit v1.2.3