repo.or.cz
/
lilypond.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
lilypond-0.1.14
[lilypond.git]
/
hdr
/
offset.hh
blob
e0b62bba7616716e14cf7e21191773387cbb5021
1
/*
2
offset.hh -- part of LilyPond
3
4
(c) 1996,97 Han-Wen Nienhuys
5
*/
6
7
#ifndef OFFSET_HH
8
#define OFFSET_HH
9
#include
"real.hh"
10
11
/// 2d vector
12
struct
Offset
{
13
Real x
,
y
;
14
15
Offset
operator
+(
Offset o
)
const
{
16
Offset
r
(*
this
);
17
r
+=
o
;
18
return
r
;
19
}
20
21
Offset
operator
+=(
Offset o
) {
22
x
+=
o
.
x
;
23
y
+=
o
.
y
;
24
return
*
this
;
25
}
26
Offset
(
Real ix
,
Real iy
) {
27
x
=
ix
;
28
y
=
iy
;
29
}
30
Offset
() {
31
x
=
0.0
;
32
y
=
0.0
;
33
}
34
};
35
36
#endif
// OFFSET_HH
37
38