Fixes a list out of bounds exception in freetype

git-svn-id: trunk@16308 -
This commit is contained in:
sekelsenmat 2010-11-06 17:00:52 +00:00
parent b6c0948bb2
commit b87e3e5057

View File

@ -433,11 +433,17 @@ end;
function TFontManager.GetFont (FontID:integer) : TMgrFont;
begin
result := TMgrFont(FList[FontID]);
if result <> CurFont then // set last used size of the font as current size
if (FontID >= 0) and (FontID < FList.Count) then
begin
result := TMgrFont(FList[FontID]);
if result <> CurFont then // set last used size of the font as current size
begin
CurSize := result.LastSize;
CurSize := result.LastSize;
end;
end
else
Result := nil;
end;
procedure TFontManager.GetSize (aSize, aResolution : integer);