mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-13 10:29:17 +02:00
* 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:
parent
b884d568e1
commit
e001876e2b
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user