- changed text-center-pos to respect the rectangle's origin
This commit is contained in:
parent
0f7e0eb189
commit
613eb1fe8d
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue