Image adjustment after cropping

Dmitry Kazakov dimula73 at gmail.com
Thu Jan 31 08:21:44 UTC 2013


>
> m_d->zoomManager->zoomController()->resetToFixedZoom();
>>
>> m_d->canvasController->setPreferredCenter(widgetSizeRect.center());
>>
>> m_d->canvasController->recenterPreferred()
>>
>>
This approach works somewhat ok, but it is needed to investigate how to
calculate widgetSizeRect.center() value. If we do it in a straightforward
way, like QPointF(widgetSize.height()/2, widgetSize.height()/2), then it
works like that:

1) When the image is heavily zoomed in, that is "documentOrigin" == 0, the
cropped area is put somewhere near to the center (not exactly, though).
2) When the image is zoomed out, origin != 0, then the image jumps to the
topleft corner o fthe widget.

I think we just need to recall how the value of the preferred center is
calculated (i would use that unittest) and calculate that properly here.

-- 
Dmitry Kazakov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kimageshop/attachments/20130131/0522c935/attachment-0001.html>


More information about the kimageshop mailing list