On Wed, Sep 23, 2009 at 4:41 PM, Julie S <[email protected]> wrote:
> I see that QTransform() is used in Panner:drawItems to get an identity matrix.

Panner::drawItems is purely an optimisation, it just caches the
results of the normal scene draw. It's supposed to have the same
result as its parent class's implementation would have, apart from the
cache, so we shouldn't be changing the transform in there.

The effective transform is stored in the QGraphicsView parent as the
viewport transform (which you'll see retrieved as viewportTransform()
at line 180).  The actual scaled draw happens in the following line,
and then the QTransform() constructed at line 186 is an identity used
to draw the cache to the window.

What we would need to do is simply change the viewport transform.
This is set every time we call QGraphicsView::fitInView(), which
happens in three places in the file.  As you see, that function has an
argument KeepAspectRatio which gives us our current scaling.  We could
supply IgnoreAspectRatio instead, which would make the scene always
fill the panner -- but if you try it, you'll see that that doesn't
exactly look great either.

What we really need is a function to replace fitInView(), that sets
the viewport transform in much the same way as the graphics view's
default fitInView() does, except that it permits the x and y scale
factors to vary within reasonable limits (perhaps up to ratio of 2:1)
if the scene's geometry is very extreme.


Chris

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Rosegarden-devel mailing list
[email protected] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel

Reply via email to