resolved bug when rect=nil

Darek
Index: interfaces/gtk/gtkwinapi.inc
===================================================================
--- interfaces/gtk/gtkwinapi.inc        (wersja 9401)
+++ interfaces/gtk/gtkwinapi.inc        (kopia robocza)
@@ -6504,17 +6501,27 @@
     {$ENDIF}
   end;
   Result := True;
-  gdkRect.X := Rect^.Left;
-  gdkRect.Y := Rect^.Top;
-  gdkRect.Width := (Rect^.Right - Rect^.Left);
-  gdkRect.Height := (Rect^.Bottom - Rect^.Top);
-
   PaintWidget:=GetFixedWidget(Widget);
   if PaintWidget=nil then PaintWidget:=Widget;
 
+  if Rect = nil then begin
+    gdkRect.X := 0;//PaintWidget^.Allocation.X;
+    gdkRect.Y := 0;//PaintWidget^.Allocation.Y;
+    gdkRect.Width:=PaintWidget^.Allocation.Width;
+    gdkRect.Height:=PaintWidget^.Allocation.Height;
+
+  end else begin
+    gdkRect.X := Rect^.Left;
+    gdkRect.Y := Rect^.Top;
+    gdkRect.Width := (Rect^.Right - Rect^.Left);
+    gdkRect.Height := (Rect^.Bottom - Rect^.Top);
+  end;
+
+
   {$IfDef GTK2}
     if (PaintWidget<>nil) and GTK_WIDGET_NO_WINDOW(PaintWidget)
       and (not GtkWidgetIsA(PGTKWidget(PaintWidget),GTKAPIWidget_GetType))
+      and (Rect<>nil)
     then begin
       Inc(gdkRect.X, PaintWidget^.Allocation.x);
       Inc(gdkRect.Y, PaintWidget^.Allocation.y);

Reply via email to