From 2253e9047957e797a603a979c43fc9f11a2803df Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Thu, 22 Nov 2012 11:03:45 -0600 Subject: [PATCH] fix blubox / lock coordinate computation when the blue box doesn't fit in the visible region in one direction (either x or y) but does fit in the other region, then it was being drawn in the wrong place This code is still sub-optimal, since it isn't leaving space for the words underneath the lock in the case the lock is near the bottom of the visible region, but it seems better to just let that be invisible rather than make the lock float a bit in that case. closes PR 13142 --- collects/drracket/private/syncheck/blueboxes-gui.rkt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/collects/drracket/private/syncheck/blueboxes-gui.rkt b/collects/drracket/private/syncheck/blueboxes-gui.rkt index 7f00ec8707..6ef7897c10 100644 --- a/collects/drracket/private/syncheck/blueboxes-gui.rkt +++ b/collects/drracket/private/syncheck/blueboxes-gui.rkt @@ -348,9 +348,13 @@ (define bmp-view-x (+ view-left blue-box-margin)) (define bmp-view-y (- view-bottom blue-box-margin lock-height)) (cond - [(or (bmp-bluebox-x . <= . bmp-view-x) - (bmp-bluebox-y . >= . bmp-view-y)) + [(and (bmp-bluebox-x . <= . bmp-view-x) + (bmp-bluebox-y . >= . bmp-view-y)) (values br bt bmp-view-x bmp-view-y)] + [(bmp-bluebox-y . >= . bmp-view-y) + (values br bt bmp-bluebox-x bmp-view-y)] + [(bmp-bluebox-x . <= . bmp-view-x) + (values br bt bmp-view-x bmp-bluebox-y)] [else (values br bt bmp-bluebox-x bmp-bluebox-y)])] [else