[scribus-dev] Question about culling area

Elvis Stansvik elvstone at gmail.com
Thu Aug 11 06:56:15 UTC 2011


Having a conversation with myself here..

2011/8/11 Elvis Stansvik <elvstone at gmail.com>:
> After reading my mail I realize it wasn't crystal clear, so in short:
>
> If a cell is being edited, I'd like the painter in
> PageItem_Table::DrawObj_Item to be clipped to the content rectangle of
> the cell.
>
> In _all_ other cases, I'd like it clipped to the PoLine (frame rectangle).
>
> One way to solve this would be to give PageItem_Table the concept of
> an "active cell". E.g. something like
>
> bool m_isEditing;
> TableCell m_activeCell
> setActiveCell(const TableCell &cell);
> TableCell activeCell() const;
>
> And change code in DrawObj_Item(..) to:
>
> if (isEditing)
>    p->setupPolygon(polygon); // With polygon created from m_activeCell...
> else
>    p->setupPolygon(&PoLine); // Just use the PoLine..
>
> p->setClipPath();
>
> I'm currently keeping track of the "active cell" locally in my table
> editing canvas mode. I'm not sure it makes sense to keep it on the
> table like this.

Thinking a bit more about it, of course this makes sense, since the PP
and context menu et.c. will need to be able to query the table for
this information.

I'll go with something like this approach and see how it works out.

One thing I need to get right is that when the cursor is positioned in
a cell and something is typed, only the cell rect should be
re-painted. But when the cursor is positioned in a cell and the user
removes a row, the whole table (for now) of course needs to be
repainted. So I'll need to find a way to distinguish to the two.

Elvis



More information about the scribus-dev mailing list