From 7f0a692b94a4bad74e1b41a383fe6f491b0aaa4d Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Wed, 13 May 2015 18:36:09 -0700 Subject: [PATCH] wrap-typed tweak --- quad/core-types.rkt | 2 +- quad/wrap-typed.rkt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/quad/core-types.rkt b/quad/core-types.rkt index d3fc345d..248cf8dd 100644 --- a/quad/core-types.rkt +++ b/quad/core-types.rkt @@ -49,4 +49,4 @@ (define-predicate Index? Index) -(define-type+predicate Breakpoint Index) +(define-type+predicate Breakpoint Nonnegative-Integer) diff --git a/quad/wrap-typed.rkt b/quad/wrap-typed.rkt index d6ef9743..262adb9f 100644 --- a/quad/wrap-typed.rkt +++ b/quad/wrap-typed.rkt @@ -437,7 +437,7 @@ (define line-width (get-line-width (make-trial-line pieces-rendered-widths pieces-rendered-before-break-widths ;; add1 does not preserve Index type, so assert - line-starting-bp (assert (add1 j-1) index?)))) + line-starting-bp (add1 j-1)))) (if (fl> line-width (fl* world:allowed-overfull-ratio measure)) (values (cons j-1 bps) (cons line-width line-widths)) (values bps line-widths)))) @@ -500,7 +500,7 @@ 0.0) (fl world:new-line-penalty) ($penalty->value penalty-up-to-i) - (let ([line-width (get-line-width (make-trial-line pieces-rendered-widths pieces-rendered-before-break-widths (assert i index?) (assert j index?)))]) + (let ([line-width (get-line-width (make-trial-line pieces-rendered-widths pieces-rendered-before-break-widths i j))]) (cond ;; overfull line: huge penalty prevents break; multiplier is essential for monotonicity. ;; multiply by -1 because line-width is longer than measure, thus diff is negative