bugGNU Octave - Bugs: bug #44304, Qt figure zoom and unzoom on mouse...

 
 

bug #44304: Qt figure zoom and unzoom on mouse click

Submitted by:  Mike Miller <mtmiller>
Submitted on:  Thu 19 Feb 2015 05:25:48 AM UTC  
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  Closed
Release:  dev Operating System:  Any

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

( Jump to the original submission)

Sat 18 Apr 2015 01:18:33 AM UTC, comment #8: 

I changed the Qt click behavior to zoom out by 2, rather than return to the cached zoom level, since this is what Matlab appears to do.  See cset (http://hg.savannah.gnu.org/hgweb/octave/rev/c6c5cb9c4743).  Closing report.

Rik <rik5>
Project Administrator
Wed 08 Apr 2015 12:58:40 AM UTC, comment #7: 

It looks like this is almost right, except that when doing a Shift+Left Click or a right click, the behavior should be to zoom out by a factor of 2, not perform an unzoom back to the original axes layout.

The code is in Canvas.cc, Canvas::canvasMouseReleaseEvent.  But I think the zoom would be better placed in the Canvas::canvasMousePressEvent routine.  Basing decisions on the release event doesn't allow for distinguishing between single and double click events which is otherwise quite easy.

Rik <rik5>
Project Administrator
Tue 03 Mar 2015 04:59:41 AM UTC, comment #6: 

I checked in the following changeset to eliminate the "zoom stack".  Now we just save the initial x, y, and z limits and the view and restore those.

http://hg.savannah.gnu.org/hgweb/octave/rev/0c32e02d60c3

John W. Eaton <jwe>
Project Administrator
Fri 20 Feb 2015 12:35:49 PM UTC, comment #5: 

As to zooming & mouse actions:
Like Mike says, ML has a right-click menu with option "Reset to original view".
See also comment #2 of bug #44307

Philip Nienhuis <philipnienhuis>
Project Member
Thu 19 Feb 2015 07:39:43 AM UTC, comment #4: 

Yeah, I have the same experience with double-clicking. But it's described on the Matlab plotting page

http://www.mathworks.com/help/matlab/ref/zoom.html

so it's probably worth keeping.

The way I read that page, Shift+click and right click do not undo some kind of a zoom stack, but just zoom out by a factor just like the scroll wheel does. I haven't seen any reference to a zoom stack in the Matlab docs. It just seems like they have a concept of original zoom level, and zooming in and out by a certain factor, no "undo" or "back" to the last zoom level.

And the zoom direction on left click is backwards, as described in bug #44302, so I'm guessing it's a lower-level function that has the zoom directions reversed.

Mike Miller <mtmiller>
Project Administrator
Thu 19 Feb 2015 06:56:08 AM UTC, comment #3: 

OK, I checked in the following change so shift + left button zooms out:

  http://hg.savannah.gnu.org/hgweb/octave/rev/eebe8da58f8d

So now

  shift + left button AND right button zoom out one step

and

  double left click and middle click clear the zoom stack and zoom out to the first element of the zoom stack

Do we really need both in each case, or should we eliminate one?

In my limited testing, I find the double click to cause trouble because I click too fast and end up clearing the zoom stack instead of just zooming out one step.

John W. Eaton <jwe>
Project Administrator
Thu 19 Feb 2015 06:39:06 AM UTC, comment #2: 

Oops, wrong bug report...

John W. Eaton <jwe>
Project Administrator
Thu 19 Feb 2015 06:38:09 AM UTC, comment #1: 

I checked in the following changeset to allow the zoom factor to be set using the mousewheelzoom axes property.  To set a default for all axes, set defaultaxesmousewheelzoom in the root figure properties.

  http://hg.savannah.gnu.org/hgweb/octave/rev/ed1bafbb87ee

Maybe we should have a way to constrain the values of properties?

John W. Eaton <jwe>
Project Administrator
Thu 19 Feb 2015 05:25:48 AM UTC, original submission:  

According to

http://www.mathworks.com/help/matlab/ref/zoom.html

clicking the left mouse button (without dragging) while in zoom mode should zoom in by a factor of 2. Clicking the left mouse button while holding the Shift key should zoom out by a factor of 2.

Currently a left click zooms out and a Shift + left click does nothing.

Mike Miller <mtmiller>
Project Administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by mtmiller (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-04-18 rik5 StatusIn Progress => Fixed
        Open/ClosedOpen => Closed
    2015-04-08 rik5 StatusNone => In Progress

    Back to the top


    Powered by Savane 3.5