chenbo007 / svg-edit

Automatically exported from code.google.com/p/svg-edit
0 stars 0 forks source link

Need a way to rotate via mouse #103

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
At present, a user can only rotate elements by interacting with the spinner
control in the contextual tool panel.  It would be good to have a way to do
this via the mouse.

Last night I had an idea around this:  What about a rotator grip that is
drawn as part of the selected box.  The rotator grip would be drawn on top
of the center of the selected object when it's selected.  The grip would be
a circle with a small line that indicates the current angle (with 0 degrees
pointing straight up).  The user could then drag this line around to the
angle that they want.

Potential UI problems:

1) what color to draw the rotator grip?  what happens if the selected
object happens to be the same color?  will have to ensure the grip has two
colors in this case.

2) what happens if it's a small object? the rotator grip might obscure the
object itself.  maybe only draw the rotator if the element is above a
certain size (say 50 pixels in each direction).  Problem gets somewhat
alleviated with an implementation of zoom.

3) will it be annoying to see the rotator grip every time you select an
element?  we could have it only appear if you click again on a selected
element, but then it is not as discoverable.

Original issue reported on code.google.com by codedr...@gmail.com on 19 Aug 2009 at 4:45

GoogleCodeExporter commented 9 years ago
It just occurred to me that we could also only show the rotator grip if the user
mouses over the selected element, that might be less annoying (#3 above)

Original comment by codedr...@gmail.com on 19 Aug 2009 at 5:42

GoogleCodeExporter commented 9 years ago
How about allowing rotate with the mousewheel? Another option is to make the 
handles 
rotate the image if you click the object twice, so that it toggles between 
rotation 
and translation. I suppose mousewheel might make more sense for scaling though.

An example: http://xn--dahlstrm-t4a.net/svg/svglolcats/lolcats.svg (hover text, 
then 
scroll up and down to rotate)

Original comment by erik.dah...@gmail.com on 19 Aug 2009 at 5:44

GoogleCodeExporter commented 9 years ago
mousewheel - very cool idea Erik!  Though you have a point, mousewheel probably 
makes
sense for zooming the entire editor's canvas or something so we might want to 
save
that.  Also, I don't have a mousewheel on my macbook pro..

Then I checked out your lolcats, and i can two-finger-scroll on my trackpad and 
the
rotate works just fine. :)

I've thought about the click-handles-twice thing.  I know that's how Inkscape 
does
it, but something about it doesn't make me happy.  Maybe it's because it's one 
more
click, maybe it's because it's not as discoverable?  It might be the way we go 
though
if enough people agree.

Original comment by codedr...@gmail.com on 19 Aug 2009 at 5:51

GoogleCodeExporter commented 9 years ago
The way the google.docs svg drawing thingie does rotate is discoverable and 
easy to 
use, but it covers a bit more of the object.

Original comment by erik.dah...@gmail.com on 19 Aug 2009 at 5:53

GoogleCodeExporter commented 9 years ago
I also like your lolcats hover-menu, I might need to steal that.  Maybe that's 
the
route we need to go:  hover over an element to get a small set of buttons to
manipulate (rotate-left, rotate-right, delete, clone, increase-text-size,
decrease-text-size).  Of course there could be problems with the positioning of 
that
little popup, etc.

Need to think about it some more I guess.

Original comment by codedr...@gmail.com on 19 Aug 2009 at 5:54

GoogleCodeExporter commented 9 years ago
Actually I _LOVE_ the way Google Docs drawing does it.  Perfectly 
understandable,
doesn't cover up the object at all (the handle is outside the selector).

I think we have a winner! :)

Original comment by codedr...@gmail.com on 19 Aug 2009 at 5:57

GoogleCodeExporter commented 9 years ago
Of course they rotate their selector box as well, so it's easy to see how it's
rotated.  We might have to go down this route too.  

Anyway, I think it's fair to say that an implementation of this issue will fall 
into
the 2.4 timeframe.

Original comment by codedr...@gmail.com on 19 Aug 2009 at 5:59

GoogleCodeExporter commented 9 years ago
Issue 122 has been merged into this issue.

Original comment by codedr...@gmail.com on 25 Aug 2009 at 3:11

GoogleCodeExporter commented 9 years ago

Original comment by codedr...@gmail.com on 26 Aug 2009 at 6:46

GoogleCodeExporter commented 9 years ago
r476 has the handle as part of the selector, though it doesn't do anything yet. 
 Just
need to add a new mode ('rotating') and track x,y in mouseDown, mouseMove, 
mouseUp.

Original comment by codedr...@gmail.com on 26 Aug 2009 at 7:10

GoogleCodeExporter commented 9 years ago
I have a patch for r480 that adds the actual rotating when dragging the handle.

Original comment by Antimatter15 on 27 Aug 2009 at 12:31

Attachments:

GoogleCodeExporter commented 9 years ago
I merged a modified version of your patch in as r481, closing this issue out.  
Thanks
antimatter15!

Original comment by codedr...@gmail.com on 27 Aug 2009 at 1:03