]> gitweb.factorcode.org Git - factor.git/commitdiff
ui.gadgets.labels: use font-metrics directly.
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 17 Sep 2012 21:07:23 +0000 (14:07 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 17 Sep 2012 21:12:25 +0000 (14:12 -0700)
basis/ui/gadgets/labels/labels.factor

index 0c1aecad5270b61f6ab5c8b2a8a23d3ef537a68a..42af2b92d07520f8bd9b41290ddca660e97341e7 100644 (file)
@@ -52,18 +52,11 @@ M: label string<< ( string label -- )
 M: label pref-dim*
     >label< text-dim ;
 
-<PRIVATE
-
-: label-metrics ( label -- metrics )
-    >label< dup string? [ first ] unless line-metrics ;
-
-PRIVATE>
-
 M: label baseline
-    label-metrics ascent>> round ;
+    font>> font-metrics ascent>> round ;
 
 M: label cap-height
-    label-metrics cap-height>> round ;
+    font>> font-metrics cap-height>> round ;
 
 M: label draw-gadget*
     >label<