-(define-public (add-stroke-straight stencil stem-grob stem-up? log stroke-style offset length thickness stroke-thickness)
- "Add the stroke for acciaccatura to the given flag stencil."
- (let* ((udmult (if stem-up? 1 -1))
- (start (offset-add offset (cons 0 (* (/ length 2) udmult))))
- (end (offset-add (cons 0 (cdr offset))
- (cons (- (/ (car offset) 2)) (* (- (+ thickness (car offset))) udmult))))
+(define-public (add-stroke-straight stencil grob dir log stroke-style
+ offset length thickness stroke-thickness)
+ "Add the stroke for acciaccatura to the given flag stencil.
+The stroke starts for up-flags at `upper-end-of-flag + (0,length/2)'
+and ends at `(0, vertical-center-of-flag-end) -
+(flag-x-width/2, flag-x-width + flag-thickness)'. Here `length' is the
+whole length, while `flag-x-width' is just the x-extent and thus depends on
+the angle! Other combinations don't look as good.
+
+For down-stems the y-coordinates are simply mirrored."
+ (let* ((stem-grob (ly:grob-parent grob X))
+ (start (offset-add offset (cons 0 (* (/ length 2) dir))))
+ (end (offset-add (cons 0 (cdr offset))
+ (cons (- (/ (car offset) 2)) (* (- (+ thickness (car offset))) dir))))