[Kst] branches/work/kst/viewaspect/kst/src/libkstapp

Duncan Hanson duncan.hanson at gmail.com
Wed May 31 19:35:28 CEST 2006


I think I have basically finished what I intended to do (repair bugs
BUG:128086, BUG:127524). The issue was that the maintain aspect modifier
was not strictly enforced. The simplest solution was to determine aspect
maintaining sizes from both the x and y positions of the mouse (whereas
previously I think that it was done using only x).

While I was fixing the bugs, I cleaned the code up as well. The view
objects have a slew of different ways to handle their creation and
resize. I've brought these together into KstGfxMouseHandlerUtils and
eliminated some reproduction by basing all resizes around an anchorPoint
and a movePoint.

As long as this branch is here for us to fool around in, do you think it
might be worthwhile to repair some of the FIXME's in ksttoplevelview? 

In particular, KstTopLevelView should not know about specific view
objects. eg. Ellipses come into play in
KstTopLevelView::pressMoveLayoutModeCenteredResize. My suggestion here
is to implement a fast virtual KstViewObject::paintForResize(KstPainter&
p, const QRect& oldgeom, const QRect& newgeom) const; method and use
polymorphism. Another example of KstTopLevel view knowing about specific
viewobjects is in KstTopLevelView::pressMoveLayoutModeEndPoint, when the
viewobject must be typecast to a KstViewLine. Why don't we move all the
resizing code into the view objects themselves. Then we can eliminate
all of the direction switching code, etc. in KstTopLevel view. On a
pressMove we'll just tell relevant objects to paint resized outlines of
themselves based on a mouseOrigin and current mouse position, within
some bounds determined by KstTopLevelView. Once this is done, maybe we
can also get rid of all the KstGfxMouseHandler(Rect/Ellipse/etc.) code,
as it will basically already be implemented in the viewobjects
themselves. 

Duncan.

On Tue, 2006-05-30 at 21:14 -0700, Barth Netterfield wrote:
> Can you give a quick summary of what you are doing here?  There may be 
> comments before you get too far into it.
> 
> cbn
> 
> On Tuesday 30 May 2006 10:48, Duncan Hanson wrote:
> > SVN commit 546670 by dhanson:
> >
> > begin to standardize mouse handling code for annotation objects.
> >
> >  M  +128 -52   kstgfxmousehandlerutils.cpp
> >  M  +12 -4     kstgfxmousehandlerutils.h
> >  M  +1 -2      kstgfxpicturemousehandler.cpp
> >  M  +1 -2      kstgfxrectanglemousehandler.cpp
> >  M  +1 -2      kstgfxtextmousehandler.cpp
> >  M  +43 -65    ksttoplevelview.cpp
> >  M  +1 -1      ksttoplevelview.h
> >
> >
> > _______________________________________________
> > Kst mailing list
> > Kst at kde.org
> > https://mail.kde.org/mailman/listinfo/kst
> _______________________________________________
> Kst mailing list
> Kst at kde.org
> https://mail.kde.org/mailman/listinfo/kst



More information about the Kst mailing list