blob: 870091a941711d98c2c9651ea726969f9dcfcd60 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
#ifndef SEEN_NR_RECT_OPS_H
#define SEEN_NR_RECT_OPS_H
/*
* Rect operators
*
* Copyright 2004 MenTaLguY <mental@rydia.net>,
* bulia byak <buliabyak@users.sf.net>
*
* This code is licensed under the GNU GPL; see COPYING for more information.
*/
#include <libnr/nr-rect.h>
namespace NR {
inline Rect expand(Rect const &r, double by) {
NR::Point const p(by, by);
return Rect(r.min() + p, r.max() - p);
}
inline Rect expand(Rect const &r, NR::Point by) {
return Rect(r.min() + by, r.max() - by);
}
#if 0
inline ConvexHull operator*(Rect const &r, Matrix const &m) {
/* FIXME: no mention of m. Should probably be made non-inline. */
ConvexHull points(r.corner(0));
for ( unsigned i = 1 ; i < 4 ; i++ ) {
points.add(r.corner(i));
}
return points;
}
#endif
} /* namespace NR */
#endif /* !SEEN_NR_RECT_OPS_H */
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
|