No subject


Fri Apr 17 10:51:14 CEST 2009


at the right position, no need to translate the painter.

On the other side if you use it as source rect on the prescaled projection,
so you need to translate it back somehow.

--000e0cd24774e09a49046dd65caa
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div class=3D"gmail_quote">On Thu, Jul 2, 2009 at 6:24 PM, <a href=3D"mailt=
o:LukasT.dev at gmail.com">LukasT.dev at gmail.com</a> <span dir=3D"ltr">&lt;<a h=
ref=3D"mailto:lukast.dev at gmail.com">lukast.dev at gmail.com</a>&gt;</span> wro=
te:<br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Today I resolved =
issue with update rectangle which is moved. It was in<br>
<div class=3D"im"><br>
KisCanvas2::updateCanvasProjection(const QRect &amp; rc)<br>
</div>vRect had to be translated by origin<br>
<br>
Now the rect is in correct position from the view perspective<br>
There is line<br>
m_d-&gt;prescaledProjection-&gt;updateCanvasProjection(rc);<br>
which gets rc which is in image coordinates.<br>
<br>
in KisPrescaledProjection::updateCanvasProjection(const QRect &amp; rc)<br>
...<br>
// this does not have to be moved I think -- tool calls updateCanvasProject=
ion<br>
// with rc in image coordinates<br>
m_d-&gt;projectionCache.updateUnscaledCache( rc );<br>
<br>
// this vRect is in view coordinates (widget coordinates I suppose too) and=
<br>
// probably should be moved by origin<br>
QRect vRect =3D viewRectFromImagePixels(rc);<br>
if (!vRect.isEmpty()) {<br>
 =A0 =A0preScale(vRect);<br>
}<br>
...<br>
<br>
I will add document origin to prescale projection and test it<br>
If you have anything to say to this, let me know. And I invite you to play<=
br>
with the updated patch [1] ;)<br>
<br>
Thanks<br>
Lukas<br>
<br>
[1] <a href=3D"http://lukast.mediablog.sk/patches/qpainter_infinite_canvas.=
2.patch" target=3D"_blank">http://lukast.mediablog.sk/patches/qpainter_infi=
nite_canvas.2.patch</a><br></blockquote></div><br>Sorry I missed you on IRC=
. From what I see in patch I think there is a thinking error:<br>
<br>&lt;snip&gt;<br>
<meta name=3D"qrichtext" content=3D"1"><meta http-equiv=3D"Content-Type" co=
ntent=3D"text/html; charset=3Dutf-8"><style type=3D"text/css">
p, li { white-space: pre-wrap; }
</style>
<p style=3D"margin: 0px; text-indent: 0px;">        } else {</p>
<p style=3D"margin: 0px; text-indent: 0px;">            // Checks</p>
<p style=3D"margin: 0px; text-indent: 0px;">            //gc.fillRect(ev-&g=
t;rect(), m_d-&gt;checkBrush);</p>
<p style=3D"margin: 0px; text-indent: 0px;">            gc.fillRect(ev-&gt;=
rect(), Qt::green);</p>
<p style=3D"margin: 0px; text-indent: 0px;">        }</p>
<p style=3D"margin: 0px; text-indent: 0px;">    }</p>
<p style=3D"margin: 0px; text-indent: 0px;">    gc.setCompositionMode(QPain=
ter::CompositionMode_SourceOver);</p>
<p style=3D"margin: 0px; text-indent: 0px;">    gc.translate( m_d-&gt;origi=
n.x(), m_d-&gt;origin.y() );</p>
<p style=3D"margin: 0px; text-indent: 0px;"></p>
<p style=3D"margin: 0px; text-indent: 0px;">    if (cfg.noXRender()) {</p>
<p style=3D"margin: 0px; text-indent: 0px;">        gc.drawPixmap(ev-&gt;re=
ct(), m_d-&gt;prescaledProjection-&gt;prescaledPixmap(), ev-&gt;rect());</p=
>
<p style=3D"margin: 0px; text-indent: 0px;">    } else {</p>
<p style=3D"margin: 0px; text-indent: 0px;">        gc.drawImage(ev-&gt;rec=
t(), m_d-&gt;prescaledProjection-&gt;prescaledQImage(), ev-&gt;rect());</p>
<p style=3D"margin: 0px; text-indent: 0px;">    }</p>
<p style=3D"margin: 0px; text-indent: 0px;">    gc.translate( -m_d-&gt;orig=
in.x(), -m_d-&gt;origin.y() );</p><p style=3D"margin: 0px; text-indent: 0px=
;">&lt;/snip&gt;</p><p style=3D"margin: 0px; text-indent: 0px;"><br></p><p =
style=3D"margin: 0px; text-indent: 0px;">


More information about the kimageshop mailing list