mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-13 12:49:20 +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
|
if inheritsFrom (TFPCustomDrawFont) then
|
||||||
result := TFPCustomDrawFont(self).DoGetTextHeight (text)
|
result := TFPCustomDrawFont(self).DoGetTextHeight (text)
|
||||||
else
|
else
|
||||||
result := FCanvas.GetTextHeight (text);
|
if assigned(FCanvas) then
|
||||||
|
result := FCanvas.GetTextHeight (text)
|
||||||
|
else
|
||||||
|
result :=16; // *some* default better than none.
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TFPCustomFont.GetTextWidth (text:string) : integer;
|
function TFPCustomFont.GetTextWidth (text:string) : integer;
|
||||||
|
Loading…
Reference in New Issue
Block a user