bool
Stencil::is_empty () const
+/* If only one of X- or Y-extent is empty; such a stencil can be useful
+ * for backspacing, as with \hspace #-2, so we do not consider it empty.
+ */
{
return (expr_ == SCM_EOL
- || dim_[X_AXIS].is_empty ()
- || dim_[Y_AXIS].is_empty ());
+ || (dim_[X_AXIS].is_empty ()
+ && dim_[Y_AXIS].is_empty ()));
}
SCM
(ly:stencil-extent m X)
)))
-;; todo: fix negative space
(define-markup-command (hspace layout props amount)
(number?)
#:category align
}
@end lilypond"
(let ((corrected-space (- amount word-space)))
- (if (> corrected-space 0)
- (ly:make-stencil "" (cons 0 corrected-space) '(0 . 0))
- (ly:make-stencil "" (cons corrected-space corrected-space) '(0 . 0)))))
+ (ly:make-stencil "" (cons 0 corrected-space) '(0 . 0))))
-;; todo: fix negative space
(define-markup-command (vspace layout props amount)
(number?)
#:category align
}
@end lilypond"
(let ((amount (* amount 3.0)))
- (if (> amount 0)
- (ly:make-stencil "" (cons 0 0) (cons 0 amount))
- (ly:make-stencil "" (cons 0 0) (cons amount amount)))))
+ (ly:make-stencil "" (cons 0 0) (cons 0 amount))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;