mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 22:19:18 +02:00
gtk: a more safer code for dashes allocation
git-svn-id: trunk@22156 -
This commit is contained in:
parent
08748087fa
commit
83c67a0a1b
@ -4013,9 +4013,13 @@ begin
|
|||||||
GObject^.GDIPenWidth := dwWidth;
|
GObject^.GDIPenWidth := dwWidth;
|
||||||
SetGDIColorRef(GObject^.GDIPenColor, lplb.lbColor);
|
SetGDIColorRef(GObject^.GDIPenColor, lplb.lbColor);
|
||||||
GObject^.GDIPenDashesCount := dwStyleCount;
|
GObject^.GDIPenDashesCount := dwStyleCount;
|
||||||
|
|
||||||
|
if dwStyleCount > 0 then
|
||||||
|
begin
|
||||||
GetMem(GObject^.GDIPenDashes, dwStyleCount * SizeOf(gint8));
|
GetMem(GObject^.GDIPenDashes, dwStyleCount * SizeOf(gint8));
|
||||||
for i := 0 to dwStyleCount - 1 do
|
for i := 0 to dwStyleCount - 1 do
|
||||||
GObject^.GDIPenDashes[i] := lpStyle[i];
|
GObject^.GDIPenDashes[i] := lpStyle[i];
|
||||||
|
end;
|
||||||
|
|
||||||
Result := HPEN(PtrUInt(GObject));
|
Result := HPEN(PtrUInt(GObject));
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user