2
0
Эх сурвалжийг харах

* another fix for mantis 13171, font.gettextwidth default value

git-svn-id: trunk@14976 -
marco 15 жил өмнө
parent
commit
502ac4c8a5

+ 4 - 1
packages/fcl-image/src/fpfont.inc

@@ -65,6 +65,9 @@ begin
   if inheritsFrom (TFPCustomDrawFont) then
     result := TFPCustomDrawFont(self).DoGetTextWidth (text)
   else
-    result := FCanvas.GetTextWidth (text);
+   if assigned(FCanvas) then
+     result := FCanvas.GetTextWidth (text)
+   else 
+     result :=16; // *some* default better than none.
 end;