]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/offset.hh
release: 0.1.11
[lilypond.git] / lily / include / offset.hh
index b4ed5478aca191551e681eacec20046790d8edc9..ea22500fd7b68fe5ba706be21dfe4ff1b98968ac 100644 (file)
 
 /// 2d vector 
 struct Offset {
-    Real coordinate_a_[NO_AXES];
+  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 &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];
-    }
+  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 ();
-       return *this;
-    }
-    Offset (Real ix , Real iy) {
-       x()=ix;
-       y()=iy;
-    }
-    Offset() {
-       x()=0.0;
-       y()=0.0;
-    }
+  Offset operator+=(Offset o) {
+    x()+=o.x ();
+    y()+=o.y ();
+    return *this;
+  }
+  Offset (Real ix , Real iy) {
+    x()=ix;
+    y()=iy;
+  }
+  Offset() {
+    x()=0.0;
+    y()=0.0;
+  }
 };
 
 inline Offset
-operator+(Offset o1, Offset const& o2)
+operator+ (Offset o1, Offset const& o2)
 {
-    o1 += o2;
-    return o1;
+  o1 += o2;
+  return o1;
 }
     
 #endif // OFFSET_HH