[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: Request for comment: snapping in kivio / flake
From:       jaham () gmx ! net
Date:       2009-09-16 19:34:59
Message-ID: 200909162134.59654.jaham () gmx ! net
[Download RAW message or body]

Hi...

On Sunday 30 August 2009 14:57:22 Andrew Dorrell wrote:
> Hi,
> 
> The first thing I found myself hankering for when playing with kivio was
> snapping.  Then I found there was the start of snapping already implemented
> within flake; a snapping docker and a few menu options also.  The design
> seemed good from the perspective that snapping would be available in all
>  apps and there seems to be plenty of scope for writing new snapping
>  strategies.
> 
> However I found that the current operation of snapping didn't really meet
>  my expectations and in general seemed difficult to understand and a bit
>  clunky. So after asking on IRC I agreed to post a discussion item.
> 
> What follows is my notes on how I'd like to see snapping work (some of this
>  is already implemented, I'm just trying to be complete):

Yes as you have noted and others already pointed out, many of the things you 
are listing below are already implemented (at least partly) but still need 
some refinements ans polishing.

> 
> Requirements:
> ------------------
> 1. Objects should be easy to align with each other and the page.  As mouse
> placement can be imprecise, snapping is used to attract objects to
>  preferred positions on the page.
> 
> 2. Snapping should be applied appropriately when objects are moved,
>  resized, rotated etc.
> 
> 3. It should be possible to temporarily toggle snapping mode during object
> moving, resizing etc.  This requirement implies a modifier key be used.
> 
> 4. It should be possible to adjust the "strength" of snapping

Point 3 and 4 were already commented on by others.

> 
> 5. Objects should snap during a move or resize operation so as to:
>     a. align any edge of the object being modified with and edge of another
>         object on the page

This does already work when using the othogonal snappig strategy.

>     b. align the center of the object being modified with the center of
>         another object on the page

This is provided by the bounding box snapping strategy. The "hot position" of 
the shape has to be set to the center point. This can be accomplished from the 
geometry docker of the default tool or by middle mouse button click on the 
center point of the shape.

>     c. match the size of of the object being modified to the size of an
>         existing object on the page (resize only)
>     d. align any edge of the object with a page grid

Both of c and d are missing right now.

> 
> (As an aside I should point out that I don't like snap to grid but it will
>  be familiar and a desired feature.  Grid snapping goes bad if the grid
>  dimentions are changed or if objects are resized as a group etc.  I'd like
>  to keep grid and object snapping as separate concepts.)

As of now snapping to grid does exist and there is a snapping strategy for 
that. But it is kind of handled differently than the other snapping strategies 
as it is activated from the view menu.
Don't know if that is separate enough for you.

> 
> 6. Objects should snap during rotation so as to:
>     a. match the rotation of the object being modified to the rotation of
>  an existing, previously rotated, object on the page.

This does not exist at the moment and would probably difficult or even 
impossible to implement. Transformations on shapes are kept as transformation 
matrices so it would be difficult to extract a rotation from a arbitrary 
transformation.

>     b. align the axis of rotation with multiples of a rotation step size
>  (say 15 degrees)

There current used rotation step size is 45 degrees, activated when pressing 
the alt modifier key while rotating. I think having a second smaller stepsize 
would be a good idea.

> 
> 7.  It should be possible to snap the position and / or size of an object
>  to a ruler so that the actual drawn dimentions of the object are
>  effectively specified.  This is a little like snap to grid except that it
>  can easily be used just to fix the size of and object, not its position on
>  the page.
> 
> 8.  When snapping to another object, the grid or a ruler, visual feedback
>  will be provided so that the user can see both the object being snapped to
>  and the mode of snapping being employed.

Exists, can probably extended/improved a bit. I found it hard to think of 
intuitive and easily distiguishable snapping hints. Maybe you have some better 
ideas.

> 
> 9.  It should be possible to exclude objects from the snapping rules so
>      that no object will snap-to the excluded objects.  This would take two
>      forms:
>      a. Explicitly exclude an object by modifying its properties
>      b. Implicitly exclude an object by adjusting the page view (by zoom
>  and scroll) so that the object to be excluded is not visible.

Excluding objects from the snapping is already supported by the snapping guide 
class. Atm it is only used to prevent shape to be snapped to themselves when 
moving them. What is missing is gui so the user can specifiy those. Excluding 
shapes which are out of sight is also missing, you would have to know about 
the view for this to work. 

> 
> (Second aside: I'd like to see it possible to resize the document page in a
> similar way to any other shape - perhaps via the master page? and in that
>  case I'd expect the operation to make use of ruler snapping as well as
>  significant size snapping: tight bounding box and standard paper sizes).

That is actually a great idea. Please note that only KPresenter and Kivio have 
support for master pages. 

> 
> 
> User controls:
> ------------------
> My first hack at the controls I would expect to see on the docker for
>  snapping are:
> "snapping mode" check boxes: object; grid; ruler

That would make the selection of the kind of snapping more coarse as it is 
right now. Some of the snapping strategies are hard to use when activated 
together, so i think we should keep the individual selection of snapiing 
stratgies.

> "snapping strength" slider

There is a spinbox for the snapping distance, not sure if a slider is better 
or not. A slider will certainly need more screen space and is not as accurate 
as a direct input.

> "snap only to visible objects"

Do you mean visible as in they are in sight (e.g. in the current viewport) or 
visisble when they have the visible flag set?

> "Prevent snapping to this object" toggle.

You would need to have a property on a shape for that, which does not exist at 
the moment. You probably could use KoShape::setAdditionalAttribute for that.

Ciao Jan
_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic