[calligra] krita/ui/tool: fix artefacts on qpainter canvas
Dmitry Kazakov
dimula73 at gmail.com
Sun Jun 19 19:01:25 CEST 2011
Great! I always believed those hardcoded const values are not the real
solution! =)
On Sun, Jun 19, 2011 at 4:17 PM, Sven Langkamp <sven.langkamp at gmail.com>wrote:
> Git commit 7be561f4b4c5bd900133c0d82c2b8c6d51122cbf by Sven Langkamp.
> Committed on 19/06/2011 at 14:15.
> Pushed by langkamp into branch 'master'.
>
> fix artefacts on qpainter canvas
> BUG:275829
>
> M +9 -6 krita/ui/tool/kis_tool_freehand.cc
>
> http://commits.kde.org/calligra/7be561f4b4c5bd900133c0d82c2b8c6d51122cbf
>
> diff --git a/krita/ui/tool/kis_tool_freehand.cc
> b/krita/ui/tool/kis_tool_freehand.cc
> index 71a4f43..0d0e429 100644
> --- a/krita/ui/tool/kis_tool_freehand.cc
> +++ b/krita/ui/tool/kis_tool_freehand.cc
> @@ -677,12 +677,15 @@ void KisToolFreehand::updateOutlineRect()
> canvas()->updateCanvas(m_oldOutlineRect);
> }
>
> -#ifdef __GNUC__
> -#warning "Remove adjusted() call -- it smells hacky"
> -#else
> -#pragma WARNING( "Remove adjusted() call -- it smells hacky" )
> -#endif
> - m_oldOutlineRect = outlineDocRect.adjusted(-2,-2,2,2);
> + // This adjusted call is needed as we paint with a 3 pixel wide brush
> and the pen is outside the bounds of the path
> + // Pen uses view coordinates so we have to zoom the document value to
> match 2 pixel in view coordiates
> + // See BUG 275829
> + qreal zoomX;
> + qreal zoomY;
> + canvas()->viewConverter()->zoom(&zoomX, &zoomY);
> + qreal xoffset = 2.0/zoomX;
> + qreal yoffset = 2.0/zoomY;
> + m_oldOutlineRect =
> outlineDocRect.adjusted(-xoffset,-yoffset,xoffset,yoffset);
>
> canvas()->updateCanvas(m_oldOutlineRect);
> }
>
--
Dmitry Kazakov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kimageshop/attachments/20110619/1d2e7719/attachment.htm
More information about the kimageshop
mailing list