- (uplist (map pair-to-list
- (normalize-coords coords lenx (/ leny 2))))
- (downlist (map pair-to-list
- (normalize-coords coords lenx (/ leny -2)))))
- (ly:stencil-translate
- (ly:stencil-add
- (my-c-p-s uplist thick decresc?)
- (if mirrored? (my-c-p-s downlist thick decresc?) empty-stencil))
- (cons xtrans ytrans)))
+ (uplist (scale-coords coords lenx (/ leny 2)))
+ (downlist (scale-coords coords lenx (/ leny -2)))
+ (stil
+ (ly:stencil-aligned-to
+ (ly:stencil-translate
+ (ly:stencil-add
+ (hairpin::print-part uplist decresc? grob)
+ (if mirrored?
+ (hairpin::print-part downlist decresc? grob)
+ empty-stencil))
+ (cons xtrans ytrans))
+ Y CENTER))
+ (stil-y-extent (ly:stencil-extent stil Y)))
+ ;; Return a final stencil properly aligned in Y-axis direction and with
+ ;; proper extents. Otherwise stencil-operations like 'box-stencil' will
+ ;; return badly. Extent in X-axis direction is taken from the original,
+ ;; in Y-axis direction from the new stencil.
+ (ly:make-stencil (ly:stencil-expr stil) xex stil-y-extent))
+ ;; return empty, if no Hairpin.stencil present.