Transformation issue

Sven Langkamp sven.langkamp at gmail.com
Mon Dec 31 14:24:27 UTC 2012


On Mon, Dec 31, 2012 at 5:31 AM, Dmitry Kazakov <dimula73 at gmail.com> wrote:
>
>> I stuck there. Does anyone have an idea what might go wrong?
>
>
> Two ideas, not sure they may help though:
>
> 1) Does the resolution of the svg loads correctly to the image.{x,y}Res?

It's correct.

> 2) The QTransfrom::scale/translate methods sometimes may work a bit
> unexpectedly. Probably, you could try:
>
> matrix = QTransform::fromScale(image->xRes(), image->yRes()) *
> QTransform::fromTranslate(shape->position().x(), shape->position().y());
>
> or
>
> matrix = QTransform::fromTranslate(shape->position().x(),
> shape->position().y()) * QTransform::fromScale(image->xRes(),
> image->yRes());
>
> or
>
> matrix = shape->absoluteTransformation(0)  *
> QTransform::fromScale(image->xRes(), image->yRes());

This was the problem. I works with shape->absoluteTransformation(0) *
QTransform::fromScale(image->xRes(), image->yRes())
Thanks


More information about the kimageshop mailing list