-static SCM
-line_atom (Grob* me, Real thick, Real dx, Real dy)
-{
- SCM type = me->get_grob_property ("type");
- Real staff_space = Staff_symbol_referencer::staff_space (me);
-
- // maybe these should be in line-thickness?
- Real length = staff_space;
- SCM s = me->get_grob_property ("dash-length");
- if (gh_number_p (s))
- length = gh_scm2double (s) * staff_space;
-
- Real period = 2 * length + thick;
- s = me->get_grob_property ("dash-period");
- if (gh_number_p (s))
- period = gh_scm2double (s) * staff_space;
-
- if (type == ly_symbol2scm ("dotted-line"))
- length = thick;
-
- if (type == ly_symbol2scm ("line"))
- length = period + thick;
-
- Real on = length - thick;
- Real off = period - on;
-
- SCM list = scm_list_n (ly_symbol2scm ("dashed-line"),
- gh_double2scm (thick),
- gh_double2scm (on),
- gh_double2scm (off),
- gh_double2scm (dx),
- gh_double2scm (dy),
- SCM_UNDEFINED);
-
- return list;
+ Offset rotation_factor = complex_exp (Offset (0, dz.arg ()));
+
+ Offset points[3];
+ points[0] = Offset (0, -h / 2);
+ points[1] = Offset (w / 2, h / 2);
+ points[2] = Offset (w, -h / 2);
+ for (int i = 0; i < 3; i++)
+ points[i] = complex_multiply (points[i], rotation_factor);
+
+ Stencil squiggle (Line_interface::make_line (thick, points[0], points[1]));
+ squiggle.add_stencil (Line_interface::make_line (thick, points[1], points[2]));
+
+ Stencil total;
+ for (int i = 0; i < count; i++)
+ {
+ Stencil moved_squiggle (squiggle);
+ moved_squiggle.translate (from + Offset (i * w, 0) * rotation_factor);
+ total.add_stencil (moved_squiggle);
+ }
+
+ Box b;
+ b.add_point (Offset (0, 0));
+ b.add_point (dz);
+ b[X_AXIS].widen (thick / 2);
+ b[Y_AXIS].widen (thick / 2);
+
+ return Stencil (b, total.expr ());