lilypond-1.1.32
[lilypond.git] / hdr / offset.hh
blobe0b62bba7616716e14cf7e21191773387cbb5021
1 /*
2 offset.hh -- part of LilyPond
4 (c) 1996,97 Han-Wen Nienhuys
5 */
7 #ifndef OFFSET_HH
8 #define OFFSET_HH
9 #include "real.hh"
11 /// 2d vector
12 struct Offset {
13 Real x,y;
15 Offset operator+(Offset o)const {
16 Offset r(*this);
17 r+=o;
18 return r;
21 Offset operator+=(Offset o) {
22 x+=o.x;
23 y+=o.y;
24 return *this;
26 Offset(Real ix , Real iy) {
27 x=ix;
28 y=iy;
30 Offset() {
31 x=0.0;
32 y=0.0;
36 #endif // OFFSET_HH