diff --git a/lcl/include/dragobject.inc b/lcl/include/dragobject.inc index d23466afc8..6050a695ff 100644 --- a/lcl/include/dragobject.inc +++ b/lcl/include/dragobject.inc @@ -122,7 +122,12 @@ begin DragPos := APosition; //should have been done before Control.CalculateDockSizes; // mouse click offset from control TopLeft in screen coordinates - FDockRect.TopLeft := Control.ClientToScreen(Point(0, 0)); + with FDockRect do + begin + TopLeft := Control.ClientToScreen(Point(0, 0)); + Right := Left + Control.Width; + Bottom := Top + Control.Height; + end; if Control.Width > 0 then FDockOffset.x := Round((APosition.x - FDockRect.Left) / Control.Width * Control.UndockWidth) else