From a61b8aeaa8c26543a013647b95c25ea3c4c44b12 Mon Sep 17 00:00:00 2001 From: bdeket Date: Wed, 16 Sep 2020 21:36:50 +0200 Subject: [PATCH] legend: increase gap --- plot-lib/plot/private/plot3d/plot-area.rkt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/plot-lib/plot/private/plot3d/plot-area.rkt b/plot-lib/plot/private/plot3d/plot-area.rkt index f3e66886..31192c72 100644 --- a/plot-lib/plot/private/plot3d/plot-area.rkt +++ b/plot-lib/plot/private/plot3d/plot-area.rkt @@ -397,15 +397,16 @@ (cond [legend-rect (match-define (vector (ivl x- x+) (ivl y- y+)) legend-rect) - (define gap (* 2 (pen-gap))) - (define width (if (and x- x+) (+ gap (- x+ x-)) 0)) - (define height (if (and y- y+) (+ gap (- y+ y-)) 0)) + (define 2*gap (* 2 (pen-gap))) + (define 3*gap (* 3 (pen-gap))) + (define width (if (and x- x+) (+ 2*gap (- x+ x-)) 0)) + (define height (if (and y- y+) (+ 2*gap (- y+ y-)) 0)) (define x-size-left (- dc-x-size width)) (define y-size-left (- dc-y-size title-margin height)) - (define (left) (if (< x-size-left 0) (none) (values width 0 title-margin 0))) - (define (top) (if (< y-size-left 0) (none) (values 0 0 (+ title-margin height) 0))) - (define (bottom) (if (< y-size-left 0) (none) (values 0 0 title-margin height))) - (define (right) (if (< x-size-left 0) (none) (values 0 width title-margin 0))) + (define (left) (if (< x-size-left 0) (none) (values (+ width 3*gap) 0 title-margin 0))) + (define (top) (if (< y-size-left 0) (none) (values 0 0 (+ title-margin height 3*gap) 0))) + (define (bottom) (if (< y-size-left 0) (none) (values 0 0 title-margin (+ height 3*gap)))) + (define (right) (if (< x-size-left 0) (none) (values 0 (+ width 3*gap) title-margin 0))) (case legend-anchor [(top-left auto) (if (< y-size-left x-size-left) (left) (top))] [(left) (left)]