diff options
Diffstat (limited to 'src/libnr')
| -rw-r--r-- | src/libnr/nr-rect.cpp | 11 | ||||
| -rw-r--r-- | src/libnr/nr-rect.h | 1 |
2 files changed, 12 insertions, 0 deletions
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 { |
