mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-22 13:39:30 +02:00
gtk intf: added safety check
git-svn-id: trunk@16310 -
This commit is contained in:
parent
763fd91a65
commit
4b50534529
@ -6400,7 +6400,8 @@ begin
|
||||
begin
|
||||
Widget := PGtkWidget(Handle);
|
||||
ARect.TopLeft := GetWidgetOrigin(Widget);
|
||||
ARect.BottomRight := Point(ARect.Left + Widget^.allocation.width, ARect.Top + Widget^.allocation.height);
|
||||
ARect.BottomRight := Point(ARect.Left + Widget^.allocation.width,
|
||||
ARect.Top + Widget^.allocation.height);
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -6437,8 +6438,8 @@ function TGtkWidgetSet.GetWindowSize(Handle : hwnd;
|
||||
begin
|
||||
if GtkWidgetIsA(PGtkWidget(Handle),GTK_TYPE_WIDGET) then begin
|
||||
Result:=true;
|
||||
Width:=PGtkWidget(Handle)^.Allocation.Width;
|
||||
Height:=PGtkWidget(Handle)^.Allocation.Height;
|
||||
Width:=Max(0,PGtkWidget(Handle)^.Allocation.Width);
|
||||
Height:=Max(0,PGtkWidget(Handle)^.Allocation.Height);
|
||||
end else
|
||||
Result:=false;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user