Coordinates of the object on the page, if it is in the table
Posted: Sat Jan 03, 2026 6:27 pm
I have a question about the coordinates of the TCustomRVItemInfo object on the page. I need to draw a graphic primitive next to the object. Everything works fine, but if the object is in a table, the approach failed. Here is a part of a code:
How can I correctly take into account that an object is in a table?
Code: Select all
procedure TEditor.SRVEditPaint(Sender: TSRichViewEdit; Canvas: TCanvas; Prepaint: Boolean; PaintRect: TRect);
begin
{ .. }
PageNo := Sender.GetPageNo( RVData, Node.ItemNo, 0 );
BoundRect := Sender.GetItemBounds( RVData, Node.ItemNo );
PageClientRect := Sender.GetPageClientRect(PageNo);
X1 := BoundRect.Left + PageClientRect.Left;
Y1 := BoundRect.Top + PageClientRect.Top;
X2 := BoundRect.Right + PageClientRect.Left;
Y2 := BoundRect.Bottom + PageClientRect.Top;
Canvas.Rectangle( X1, Y1, X2, Y2 );
{ .. }
end;