diff --git a/collects/plot/common/draw.rkt b/collects/plot/common/draw.rkt index 8f9d0421f1..7d1af15fe8 100644 --- a/collects/plot/common/draw.rkt +++ b/collects/plot/common/draw.rkt @@ -306,6 +306,15 @@ (define new-top (round (+ top (- y-min param-y-min)))) (define new-bottom (round (- bottom (- (sub1 y-max) param-y-max)))) + ;; Not enough space? + (define area-x-min (+ x-min new-left)) + (define area-x-max (- x-max new-right)) + (define area-y-min (+ y-min new-top)) + (define area-y-max (- y-max new-bottom)) + (when (or (area-x-min . > . area-x-max) + (area-y-min . > . area-y-max)) + (return init-left init-right init-top init-bottom)) + ;; Early out: if the margins haven't changed much, another iteration won't change them more ;; (hopefully) (when (and (= left new-left) (= right new-right) diff --git a/collects/plot/common/gui.rkt b/collects/plot/common/gui.rkt index cb7085ab91..6a57a8491b 100644 --- a/collects/plot/common/gui.rkt +++ b/collects/plot/common/gui.rkt @@ -18,12 +18,10 @@ )) (define (make-snip-frame snip width height label) - (define (make-snip w h) - (send snip resize w h) - snip) + (define (make-snip w h) snip) (define frame - (new snip-frame% [label label] [width (+ 10 width)] [height (+ 10 height)])) + (new snip-frame% [label label] [width (+ 20 width)] [height (+ 20 height)])) (new snip-canvas% [parent frame]