From 613eb1fe8d1c6c3ac6ee1026f89278b7da405b15 Mon Sep 17 00:00:00 2001 From: frese Date: Sun, 16 Jan 2005 17:19:19 +0000 Subject: [PATCH] - changed text-center-pos to respect the rectangle's origin --- src/utils.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils.scm b/src/utils.scm index 09e84e8..06efa24 100644 --- a/src/utils.scm +++ b/src/utils.scm @@ -400,8 +400,9 @@ (define (text-center-pos rect font-struct str) (let* ((cs (text-extents font-struct str)) (tw (char-struct:width cs))) - (cons (floor* (/ (- (rectangle:width rect) tw) 2)) - (+ (floor* (/ (rectangle:height rect) 2)) + (cons (+ (rectangle:x rect) (floor* (/ (- (rectangle:width rect) tw) 2))) + (+ (rectangle:y rect) + (floor* (/ (rectangle:height rect) 2)) (font-struct:descent font-struct))))) ;; maximize-window moves and resizes the window fill as much space of