15 May 10:37
Re: Zoomer always zooms to absolute maximum zoom
From: Matthias Reich <matthias.reich <at> ipp.mpg.de>
Subject: Re: Zoomer always zooms to absolute maximum zoom
Newsgroups: gmane.comp.graphics.qwt.general
Date: 2008-05-15 08:37:15 GMT
Subject: Re: Zoomer always zooms to absolute maximum zoom
Newsgroups: gmane.comp.graphics.qwt.general
Date: 2008-05-15 08:37:15 GMT
Uwe Rathmann wrote:
> On Wednesday 14 May 2008 17:39, Matthias Reich wrote:
>
>> I have figured out, that the new ZoomBase seems to be indeed unified
>> intentionally with the current ScaleRect. The question remains then,
>> however, why this mechanism is not effective when there hasn't been any
>> zoom action, but becomes relevant after that initial zoom happens...
>
> The zoomer maintains a stack of rectangles. With setZoomBase you clear this
> stack and assign a rectangle as first element. With zoom(QwtDoubleRect) you
> can push a rectangle and with zoom(int) you navigate on the stack. With both
> calls the scales of the plot are adjusted to the corrsponding rect.
>
> If something weird is happening I recommend to debug the rectangles, that are
> pushed/popped to the stack.
Thanks for the explanation. In the meantime I have added a few necessary
(not understood, why, though) lines and get the behavior I wanted in the
first place.
this->boundingBox() iterates over all attached curves and gets the
envelope: That's the moving target (as I remove and attach curves along
the way).
----
QwtDoubleRect qdr = this->boundingBox();
if (!zoomer->isEnabled()) {
zoomer->zoom(qdr.normalized());
zoomer->setZoomBase(qdr.normalized());
zoomer->zoom(0);
}
----
achieves what I wanted and have described earlier. I still don't know
why the behavior was different before and after doing the first zoom on
the plot, when I omitted the first line, since setZoomBase should clear
the stack anyway. At the very least, the behavior shouldn't change based
on the fact whether I have zoomed before or not...
Cheers,
Matthias
---------------------------------------------------------------------
PS: Still, I like qwt very much. Please keep going
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
RSS Feed