]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lookup.cc
Move rotated_box () from Stem_tremolo:: to Lookup::
[lilypond.git] / lily / lookup.cc
index fb64bc16041861d9afdc3c47123677c57d022279..d8c20c044fcd871b36f831b83adf022ed28c0c54 100644 (file)
@@ -110,6 +110,22 @@ Lookup::dashed_slur (Bezier b, Real thick, Real dash_period, Real dash_fraction)
   return Stencil (box, at);
 }
 
+Stencil
+Lookup::rotated_box (Real slope, Real width, Real thick, Real blot)
+{
+  vector<Offset> pts;
+  Offset rot (1, slope);
+
+  thick -= 2*blot;
+  width -= 2*blot;
+  rot /= sqrt (1 + slope*slope);
+  pts.push_back (Offset (0, -thick / 2) * rot);
+  pts.push_back (Offset (width, -thick / 2) * rot);
+  pts.push_back (Offset (width, thick / 2) * rot);
+  pts.push_back (Offset (0, thick / 2) * rot);
+  return Lookup::round_filled_polygon (pts, blot);
+}
+
 Stencil
 Lookup::horizontal_line (Interval w, Real th)
 {