Fixed width calculation

svn: r4301

original commit: 407339e9353558e3428289d3dc99ad4dfd0ed8d9
This commit is contained in:
Ryan Culpepper 2006-09-11 01:02:19 +00:00
parent 1327b81ec1
commit 3c47257395

View File

@ -31,7 +31,6 @@
(define -props-panel (new horizontal-panel% (parent -split-panel))) (define -props-panel (new horizontal-panel% (parent -split-panel)))
(define props (new properties-view% (parent -props-panel))) (define props (new properties-view% (parent -props-panel)))
(define -saved-panel-percentages #f) (define -saved-panel-percentages #f)
(define canvas-width #f)
(define controller (define controller
(new syntax-controller% (new syntax-controller%
@ -129,7 +128,8 @@
(define style-list (send -text get-style-list)) (define style-list (send -text get-style-list))
(define standard (send style-list find-named-style "Standard")) (define standard (send style-list find-named-style "Standard"))
(define char-width (send standard get-text-width (send -ecanvas get-dc))) (define char-width (send standard get-text-width (send -ecanvas get-dc)))
(inexact->exact (floor (/ (send -ecanvas get-width) char-width)))) (define-values (canvas-w canvas-h) (send -ecanvas get-client-size))
(sub1 (inexact->exact (floor (/ canvas-w char-width)))))
(super-new))) (super-new)))