X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fskyline.cc;h=c935660c6ed33b400cdf2b002fc0a79f886474ab;hb=8a1a5b054688384ead32745e7f48f7f072fabeb6;hp=e55ba3a6637024de8e0a9fb36b28e53298d2098f;hpb=d8c103f73dec7a61da04f3be0ffa6a790660fb52;p=lilypond.git diff --git a/lily/skyline.cc b/lily/skyline.cc index e55ba3a663..c935660c6e 100644 --- a/lily/skyline.cc +++ b/lily/skyline.cc @@ -59,6 +59,16 @@ Skyline::print () const print_buildings (buildings_); } +void +Skyline::print_points () const +{ + vector ps (to_points (X_AXIS)); + + for (vsize i = 0; i < ps.size (); i++) + printf ("(%f,%f)%s" , ps[i][X_AXIS], ps[i][Y_AXIS], + (i%2)==1 ? "\n" : " "); +} + Building::Building (Real start, Real start_height, Real end_height, Real end) { if (isinf (start) || isinf (end)) @@ -497,7 +507,7 @@ Skyline::set_minimum_height (Real h) vector -Skyline::to_points (Axis a) const +Skyline::to_points (Axis horizon_axis) const { vector out; @@ -510,9 +520,9 @@ Skyline::to_points (Axis a) const start = i->end_; } - if (a == Y_AXIS) + if (horizon_axis == Y_AXIS) for (vsize i = 0; i < out.size (); i++) - out[i] = Offset (out[i][Y_AXIS], out[i][X_AXIS]); + out[i] = out[i].swapped (); return out; }