diff --git a/lcl/grids.pas b/lcl/grids.pas index f263ace64f..5ef0e23e93 100644 --- a/lcl/grids.pas +++ b/lcl/grids.pas @@ -7618,26 +7618,20 @@ begin // send editor bounds Msg.CellRect:=CellRect(FCol,FRow); - if (Msg.CellRect.TopFlipX(FGCache.FixedWidth))) or - (not UseRightToLeftAlignment and (Msg.CellRect.LeftFGCache.ClientHeight) or + (UseRightToLeftAlignment and ((Right-1>FlipX(FGCache.FixedWidth)) or (Right<0))) or + (not UseRightToLeftAlignment and ((LeftFGCache.ClientWidth))) then + // if editor will be out of sight, make the out of sight coords fixed + // this should avoid range check errors on widgetsets that can't handle + // high control coords (like GTK2) + Msg.CellRect := Bounds(-FEditor.Width-100, -FEditor.Height-100, Right-Left, Bottom-Top); + if FEditorOptions and EO_AUTOSIZE = EO_AUTOSIZE then begin if EditorBorderStyle = bsNone then - InflateRect(Msg.CellRect, -1, -1); - // hide editor if out of visible area - if (Msg.CellRect.Right>=0) and (Msg.CellRect.Bottom>=0) - and (Msg.CellRect.Left<=ClientWidth) and (Msg.CellRect.Top<=ClientHeight) - then begin - FEditor.Visible := true; - FEditor.BoundsRect := Msg.CellRect; - end else begin - FEditor.Visible := false; - end; + InflateRect(Msg.CellRect, -1, -1); + FEditor.BoundsRect := Msg.CellRect; end else begin Msg.LclMsg.msg:=GM_SETBOUNDS; Msg.Grid:=Self;