--- /dev/null
+\version "2.15.7"
+
+\header {
+ texidoc = "Text markup using @code{center-align} or @code{center-column} shall
+still reserve space for its whole width and not overwrite the previous stencil."
+}
+
+\markup{\left-align { AAA BB }}
+\markup{\center-align { AAA BB }}
+\markup{\right-align { AAA BB }}
+
+% Here the two center-columns should not collide with the +
+\markup \line {
+ \center-column { \line {XXX} \line {Y} }
+ "+"
+ \center-column { \line {XXX} \line {Y}}
+}
(define (general-column align-dir baseline mols)
"Stack @var{mols} vertically, aligned to @var{align-dir} horizontally."
- (let* ((aligned-mols (map (lambda (x) (ly:stencil-aligned-to x X align-dir)) mols)))
- (stack-lines -1 0.0 baseline aligned-mols)))
+ (let* ((aligned-mols (map (lambda (x) (ly:stencil-aligned-to x X align-dir)) mols))
+ (stacked-stencil (stack-lines -1 0.0 baseline aligned-mols))
+ (stacked-extent (ly:stencil-extent stacked-stencil X)))
+ (ly:stencil-translate-axis stacked-stencil (- (car stacked-extent)) X )))
(define-markup-command (center-column layout props args)
(markup-list?)
(ly:stencil? (cadr stencils)))
(let* ((tail (stack-stencil-line space (cdr stencils)))
(head (car stencils))
- (xoff (+ space (cdr (ly:stencil-extent head X)))))
+ (xoff (+ space (interval-length (ly:stencil-extent head X)))))
(ly:stencil-add head
(ly:stencil-translate-axis tail xoff X)))
(car stencils))