From ff609cb647e65e72ea510f8bf570546618fe2d4c Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 24 Mar 2002 19:50:46 +0000 Subject: [PATCH] lilypond-0.1.7 --- lily/include/offset.hh | 40 ++++++++++++++++++++++++++++------------ lily/paper-def.cc | 1 - 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/lily/include/offset.hh b/lily/include/offset.hh index bd5b269532..00bc73e0e2 100644 --- a/lily/include/offset.hh +++ b/lily/include/offset.hh @@ -6,33 +6,49 @@ #ifndef OFFSET_HH #define OFFSET_HH + #include "real.hh" +#include "axes.hh" + /// 2d vector struct Offset { - Real x,y; - - Offset operator+(Offset o)const { - Offset r(*this); - r+=o; - return r; + Real coordinate_a_[NO_AXES]; + + Real &y() { return coordinate_a_[Y_AXIS]; } + Real &x() { return coordinate_a_[X_AXIS]; } + Real y()const { return coordinate_a_[Y_AXIS]; } + Real x()const { return coordinate_a_[X_AXIS]; } + + Real &operator[](Axis i) { + return coordinate_a_[i]; + } + Real operator[](Axis i) const{ + return coordinate_a_[i]; } Offset operator+=(Offset o) { - x+=o.x; - y+=o.y; + x()+=o.x(); + y()+=o.y(); return *this; } Offset(Real ix , Real iy) { - x=ix; - y=iy; + x()=ix; + y()=iy; } Offset() { - x=0.0; - y=0.0; + x()=0.0; + y()=0.0; } }; +inline Offset +operator+(Offset o1, Offset const& o2) +{ + o1 += o2; + return o1; +} + #endif // OFFSET_HH diff --git a/lily/paper-def.cc b/lily/paper-def.cc index 4cf44b1f8d..baace2c030 100644 --- a/lily/paper-def.cc +++ b/lily/paper-def.cc @@ -51,7 +51,6 @@ Paper_def::Paper_def() itrans_p_ = 0; lookup_p_ = 0; real_vars_p_ = new Assoc; - outfile_str_ = "lelie.tex"; } Paper_def::~Paper_def() -- 2.39.5