[scribus-dev] Question about culling area
Andreas Vox
andreas.vox at googlemail.com
Thu Aug 11 08:43:55 UTC 2011
Hi Elvis!
I introduced the culling area in order to skip objects when drawing just a
rectangle part of the canvas.
Culling area = null means no limitation.
The culling area is not a clipping area, that's what PoLine is for. Can't
you use the PoLine of the cell's
textframe for your purposes?
Cheers,
/Andreas
> -----Ursprüngliche Nachricht-----
> Von: Elvis Stansvik [mailto:elvstone at gmail.com]
> Gesendet: Donnerstag, 11. August 2011 08:09
> An: Scribus Development Mailing List
> Betreff: [scribus-dev] Question about culling area
>
> Hi,
>
> The text frames of the cells are painted as part of the normal table
> painting. However, I obviously don't want to re-paint the entire table
> on each keystroke in a cell.
>
> Currently, PageItem_Table::DrawObj_Item(...) sets the clip path to the
> PoLine (frame rectangle) unconditionally before painting. Like this:
>
> // Set the clip path.
> p->setupPolygon(&PoLine);
> p->setClipPath();
>
> I would like to change this so that it actually respects the QRectF
> argument passed to DrawObj_Item(..). This would allow me to do
> something like this after text is typed in a cell:
>
> m_canvas->update(canvasToLocal(cell.contentRect()));
>
> A lot of unnecessary code paths would still be followed in the table
> painting code, but at least the actual stroking where it's not needed
> would be avoided.
>
> There's a problem however: In PageItem::DrawObj(..), which is the
> function calling my DrawObj_Item(..) there's this snippet of code:
>
> if (cullingArea.isNull())
> {
> cullingArea = QRectF(QPointF(m_Doc->minCanvasCoordinate.x(),
> m_Doc->minCanvasCoordinate.y()),
> QPointF(m_Doc-
> >maxCanvasCoordinate.x(),
> m_Doc->maxCanvasCoordinate.y())).toAlignedRect();
> }
>
> This means that if the passed rectangle is null, it's setting the
> culling area to the entire canvas. Why is it doing this? Why not use
> the bounding rectangle of the item?
>
> Because of this, there's really no way for me to know when to use the
> PoLine as clip path, and when to use the passed in rectangle.
>
> I hope you see what I mean.
>
> Regards,
> Elvis
>
> _______________________________________________
> scribus-dev mailing list
> scribus-dev at lists.scribus.net
> http://lists.scribus.net/mailman/listinfo/scribus-dev
More information about the scribus-dev
mailing list