]> gitweb.factorcode.org Git - factor.git/commitdiff
core-text: always create at least a 1x1 bitmap context. snow leopard refuses to creat...
authorJoe Groff <arcata@gmail.com>
Wed, 26 Aug 2009 19:58:15 +0000 (14:58 -0500)
committerJoe Groff <arcata@gmail.com>
Wed, 26 Aug 2009 19:58:15 +0000 (14:58 -0500)
basis/core-text/core-text.factor

index 4add71b08fdd4cb7b9b86e789c1f6f675084e4e7..52f4eb5e2e97a3ba63ef73f8025da20dadb6825d 100644 (file)
@@ -2,10 +2,11 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: arrays alien alien.c-types alien.syntax kernel destructors
 accessors fry words hashtables strings sequences memoize assocs math
-math.vectors math.rectangles math.functions locals init namespaces
-combinators fonts colors cache core-foundation core-foundation.strings
-core-foundation.attributed-strings core-foundation.utilities
-core-graphics core-graphics.types core-text.fonts core-text.utilities ;
+math.order math.vectors math.rectangles math.functions locals init
+namespaces combinators fonts colors cache core-foundation
+core-foundation.strings core-foundation.attributed-strings
+core-foundation.utilities core-graphics core-graphics.types
+core-text.fonts core-text.utilities ;
 IN: core-text
 
 TYPEDEF: void* CTLineRef
@@ -120,7 +121,7 @@ TUPLE: line < disposable line metrics image loc dim ;
                 (ext) [ (loc) (dim) v+ ]
                 loc [ (loc) [ floor ] map ]
                 ext [ (loc) (dim) [ + ceiling ] 2map ]
-                dim [ ext loc [ - >integer ] 2map ]
+                dim [ ext loc [ - >integer 1 max ] 2map ]
                 metrics [ open-font line compute-line-metrics ] |
 
             line >>line
@@ -149,4 +150,4 @@ SYMBOL: cached-lines
 : cached-line ( font string -- line )
     cached-lines get [ <line> ] 2cache ;
 
-[ <cache-assoc> cached-lines set-global ] "core-text" add-init-hook
\ No newline at end of file
+[ <cache-assoc> cached-lines set-global ] "core-text" add-init-hook