@@ -1231,13 +1231,30 @@ If the namespace does not, they are colored the unbound color.
1231
1231
(when (update-latent-arrows mouse-x mouse-y)
1232
1232
(start-arrow-draw-timer syncheck-arrow-delay)))
1233
1233
(let ([draw-arrow2
1234
- (λ (arrow)
1234
+ (λ (arrow
1235
+ #:x-min [var-arrow-end-x-min #f ]
1236
+ #:x-max [var-arrow-end-x-max #f ])
1237
+ ;; care only about end-x!
1235
1238
(define-values (start-x start-y end-x end-y)
1236
1239
(get-arrow-poss arrow))
1237
1240
(unless (and (= start-x end-x)
1238
1241
(= start-y end-y))
1242
+ (define smaller-x (min start-x end-x))
1243
+ (define larger-x (max start-x end-x))
1244
+ (define %age
1245
+ (cond
1246
+ [(and var-arrow-end-x-min var-arrow-end-x-max)
1247
+ (define base-%age
1248
+ (/ (- end-x var-arrow-end-x-min)
1249
+ (- var-arrow-end-x-max var-arrow-end-x-min)))
1250
+ (if (< (var-arrow-start-pos-left arrow)
1251
+ (var-arrow-end-pos-left arrow))
1252
+ base-%age
1253
+ (- base-%age))]
1254
+ [else #f ]))
1239
1255
(drracket:arrow:draw-arrow dc start-x start-y end-x end-y dx dy
1240
- #:pen-width 2 )
1256
+ #:pen-width 2
1257
+ #:%age %age)
1241
1258
(when (and (var-arrow? arrow) (not (var-arrow-actual? arrow)))
1242
1259
(define old-font (send dc get-font))
1243
1260
(send dc set-font
@@ -1289,6 +1306,18 @@ If the namespace does not, they are colored the unbound color.
1289
1306
cursor-text)
1290
1307
(define arrow-records-at-cursor (fetch-arrow-records cursor-text cursor-pos))
1291
1308
(define tail-arrows '() )
1309
+ (define arrows-count (- (length (filter var-arrow? arrow-records-at-cursor)) 1 ))
1310
+ (define-values (var-arrow-end-x-min var-arrow-end-x-max)
1311
+ (for/fold ([x-min #f ]
1312
+ [x-max #f ])
1313
+ ([(ele _ ) (in-hash current-matching-identifiers)])
1314
+
1315
+ (match-define (list end-text pos-left pos-right) ele)
1316
+ (define-values (end-x end-y)
1317
+ (find-poss end-text pos-left pos-right 1/2 1/2 ))
1318
+ (values (if x-min (min x-min end-x) end-x)
1319
+ (if x-max (max x-max end-x) end-x))))
1320
+
1292
1321
(when arrow-records-at-cursor
1293
1322
(for ([ele (in-list arrow-records-at-cursor)])
1294
1323
(cond [(var-arrow? ele)
@@ -1297,7 +1326,9 @@ If the namespace does not, they are colored the unbound color.
1297
1326
(send dc set-brush (get-untacked-brush)))
1298
1327
(begin (send dc set-pen (get-templ-pen))
1299
1328
(send dc set-brush (get-untacked-brush))))
1300
- (draw-arrow2 ele)]
1329
+ (draw-arrow2 ele
1330
+ #:x-min var-arrow-end-x-min
1331
+ #:x-max var-arrow-end-x-max)]
1301
1332
[(tail-arrow? ele)
1302
1333
(set! tail-arrows (cons ele tail-arrows))])))
1303
1334
0 commit comments