;; (define-public (make-graceless-rhythmic-location loc)
;; (define-public rhythmic-location-measure-position cdr)
;; (define-public rhythmic-location-bar-number car)
;; (define-public (rhythmic-location<? a b)
;; (define-public (make-graceless-rhythmic-location loc)
;; (define-public rhythmic-location-measure-position cdr)
;; (define-public rhythmic-location-bar-number car)
;; (define-public (rhythmic-location<? a b)
;; we can actually do better by sorting the regions as well,
;; but let's leave that for future extensions.
;;
(define-public (system-clipped-x-extent system-grob clip-region)
"Return the X-extent of @var{system-grob} when clipped with
@var{clip-region}. Return @code{#f} if not appropriate."
;; we can actually do better by sorting the regions as well,
;; but let's leave that for future extensions.
;;
(define-public (system-clipped-x-extent system-grob clip-region)
"Return the X-extent of @var{system-grob} when clipped with
@var{clip-region}. Return @code{#f} if not appropriate."
(let*
((region-start (car clip-region))
(columns (ly:grob-object system-grob 'columns))
(region-end (cdr clip-region))
(found-grace-end #f)
(let*
((region-start (car clip-region))
(columns (ly:grob-object system-grob 'columns))
(region-end (cdr clip-region))
(found-grace-end #f)
(loc (ly:grob-property column 'rhythmic-location))
(grace-less (make-graceless-rhythmic-location loc))
)
(loc (ly:grob-property column 'rhythmic-location))
(grace-less (make-graceless-rhythmic-location loc))
)
(and (rhythmic-location? loc)
(rhythmic-location<=? region-start loc)
(or (rhythmic-location<? grace-less region-end)
(and (rhythmic-location? loc)
(rhythmic-location<=? region-start loc)
(or (rhythmic-location<? grace-less region-end)
(interval-end
(ly:grob-robust-relative-extent
(if (= (1- (ly:grob-array-length columns)) (cdr column-range))
system-grob
(ly:grob-array-ref columns (cdr column-range)))
system-grob X)))
(interval-end
(ly:grob-robust-relative-extent
(if (= (1- (ly:grob-array-length columns)) (cdr column-range))
system-grob
(ly:grob-array-ref columns (cdr column-range)))
system-grob X)))