* fix for mantis #13171, a default for gettextheight so that it doesn't

totally fall apart if no canvas is assigned.

git-svn-id: trunk@14950 -
This commit is contained in:
marco 2010-02-27 19:14:28 +00:00
parent b884d568e1
commit e001876e2b

View File

@ -54,7 +54,10 @@ begin
if inheritsFrom (TFPCustomDrawFont) then
result := TFPCustomDrawFont(self).DoGetTextHeight (text)
else
result := FCanvas.GetTextHeight (text);
if assigned(FCanvas) then
result := FCanvas.GetTextHeight (text)
else
result :=16; // *some* default better than none.
end;
function TFPCustomFont.GetTextWidth (text:string) : integer;