mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-10 14:19:21 +02:00
cocoa: adding a check for TCocoaTextLayout.Draw procedure. Do nothing if string is empty or invalid. Prevents SynEdit crashes for unicode characters
git-svn-id: trunk@59196 -
This commit is contained in:
parent
bbd07791c8
commit
7e97caf04a
@ -1349,6 +1349,10 @@ var
|
||||
I, Count: NSUInteger;
|
||||
transform : NSAffineTransform;
|
||||
begin
|
||||
Range := FLayout.glyphRangeForTextContainer(FTextContainer);
|
||||
if Range.length = 0 then
|
||||
Exit; // cannot render anything. string is empty or invalid characters
|
||||
|
||||
if not ctx.isFlipped then
|
||||
Context := NSGraphicsContext.graphicsContextWithGraphicsPort_flipped(ctx.graphicsPort, True)
|
||||
else
|
||||
@ -1369,7 +1373,6 @@ begin
|
||||
transform.concat;
|
||||
end;
|
||||
|
||||
Range := FLayout.glyphRangeForTextContainer(FTextContainer);
|
||||
Pt.x := X;
|
||||
Pt.y := Y;
|
||||
if Assigned(DX) then
|
||||
|
Loading…
Reference in New Issue
Block a user