<div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Thanks for help!<br>Now it's not so strange =)<br></blockquote></div>
<br>Strange again..<br><br>It seems that KisFreehandTool writes into original layer _twice_ during non-incremental painting.<br>First, here:<br><br><font face="courier new,monospace">void KisToolFreehand::setDirty(const QRegion& region)<br>
{<br> if (region.numRects() < 1)<br> return;<br><br> if (!m_paintOnSelection) {<br>// SOME DATA BitBlt'ed into original layer here<br> currentNode()->setDirty(region);<br> } else {<br> /// skipped<br>
///...<br> }<br>}<br><br><span style="font-family: arial,helvetica,sans-serif;">And second time, when painting is finished, in KisToolFreehand::endPaint()<br>...<br> <span style="font-family: courier new,monospace;">painter.beginTransaction(m_transactionText);</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> QRegion r = m_incrementalDirtyRegion;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> QVector<QRect> dirtyRects = r.rects();</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> QVector<QRect>::iterator it = dirtyRects.begin();</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> QVector<QRect>::iterator end = dirtyRects.end();</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> while (it != end) {</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> painter.bitBlt(it->x(), it->y(), m_compositeOp, m_target,</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> m_opacity,</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> it->x(), it->y(),</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> it->width(), it->height());</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> ++it;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> }</span></span><br><font face="arial,helvetica,sans-serif">...<br>
<br>Could you explain me what this code does? And why we write into original layer twice? <br><br>I get some strange stuff because of that, as first write access is done without any mementoing at all. I mean no transaction opened during this write! And this is quite strange for me...<br>
</font><br></font><br clear="all"><br>-- <br>Dmitry Kazakov<br>