Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | fixed multiline text label |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
5c8595d58be0f8a99a45122731a61903 |
User & Date: | aldo 2016-09-12 17:26:08 |
Context
2016-09-12
| ||
17:27 | added multiline text to label in demo2.ss check-in: 543f2597d0 user: aldo tags: trunk | |
17:26 | fixed multiline text label check-in: 5c8595d58b user: aldo tags: trunk | |
2016-09-09
| ||
17:29 | improved css system, validation, inherit, initial check-in: 44e44daf1a user: aldo tags: trunk | |
Changes
Changes to widgets.ss.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
(draw-rect x y w h) (let ([lines (string-split text (char-set #\newline))] [x* x] [y* y] [w* 0] [h* 0]) (if (= 1 (length lines)) (let ([extents (draw-text/centered (car lines) (+ x (/ w 2)) (+ y (/ h 2)))]) (set! w* (car extents)) (set! h* (cadr extents))) (let loop ([l lines]) (unless (null? l) (let ([extents (draw-text/centered (car l) (+ x* (/ w 2)) (+ y h*))]) (set! h* (+ h* (* (mi-line-height) (cadr extents)))) (set! w* (max w* (car extents))) (loop (cdr l)))))) (mi-element-content-size-set! (mi-el) (list w* h*))) #f))) (define (debug-tooltip) (define id (mi-hot-item)) (when id |
| | > > > | | | |
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
(draw-rect x y w h) (let ([lines (string-split text (char-set #\newline))] [x* x] [y* y] [w* 0] [h* 0]) (if (= 1 (length lines)) (let ([extents (draw-text/centered (car lines) (+ x (/ w 2)) (+ y (/ h 2)))]) (set! w* (car extents)) (set! h* (mi-font-size))) (let loop ([l lines]) (unless (null? l) (let ([extents (draw-text/centered (car l) (+ x* (/ w 2)) (+ y* (mi-font-size)))]) (set! y* (+ y* (* (mi-line-height) (mi-font-size)))) (set! h* (+ h* (* (mi-line-height) (mi-font-size)))) (set! w* (max w* (car extents))) (loop (cdr l)))))) (mi-element-content-size-set! (mi-el) (list w* h*))) #f))) (define (debug-tooltip) (define id (mi-hot-item)) (when id |