bugGNU Octave - Bugs: bug #52588, Crazy Scrolling in imagesc

 
 

bug #52588: Crazy Scrolling in imagesc

Submitted by:  None
Submitted on:  Tue 05 Dec 2017 10:33:49 AM UTC  
 
Category: Plotting with OpenGLSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Other
Status: FixedAssigned to: None
Originator Name: Originator Email: -unavailable-
Open/Closed: ClosedRelease: 4.2.1
Operating System: Microsoft Windows

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Thu 07 Dec 2017 01:09:35 AM UTC, comment #5:

@Pantxo: Awesome, that was quick work. I applied the patch to the stable branch here (http://hg.savannah.gnu.org/hgweb/octave/rev/708b98b4cdd1).

This will be a part of the 4.2.2 bug fix release expected by the end of the year.

Marking as fixed and closing report.

Rik <rik5>
Project Administrator
Wed 06 Dec 2017 01:00:36 PM UTC, comment #4:

I attached a patch that implements the behavior described in comment #1.

(file #42582)

Pantxo Diribarne <pantxo>
Project Member
Tue 05 Dec 2017 11:36:01 PM UTC, comment #3:

Note that FLTK is a little more similar to gnuplot toolkit in terms of zooming and panning, except the FLTK toolkit has panning via click-drag while gnuplot doesn't. (gnuplot has a zoom feature .)

Furthermore, for the Qt and FLTK toolkits the plot space can be rotated for which the image object does not rotate but merely scales and interferes with the plot background surface. That looks very odd, but I'm sure rotated images in OpenGL wouldn't be a simple feature to add. gnuplot has a feature (not utilized in Octave, I believe) for which images can be rotated in 3D space (see last example here):

http://gnuplot.sourceforge.net/demo_5.1/image2.html

My memory is that if there isn't some underlying support for rotated images in the library/platform selected, gnuplot will attempt drawing pixels as parallelograms using the polygon feature, a method that is much, much slower but works.

Dan Sebald <sebald>
Tue 05 Dec 2017 06:18:51 PM UTC, comment #2:

Confirmed. I agree with Pantxo that Octave should use a normal convention, like graphics programs, for what happens when pan mode is on.

Check out the pan() command. It is possible to set the pan mode to x-only, y-only, or both. The default, when the user selects pan, is for panning in both x and y directions to be allowed. I think what is happening is that when the mouse wheel is used, the code checks the pan mode. It sees that both pan-x and pan-y are on, and so it increments both (for wheel up) which produces a panning along the diagonal. Probably just need a test for whether the SHIFT key is pressed.

The code is in libgui/graphics/Canvas.cc. The callback routine is

The actual case in the switch statement is at line 982.

In pseudo-code, what has to happen is

Rik <rik5>
Project Administrator
Tue 05 Dec 2017 02:06:22 PM UTC, comment #1:

Here is what I observe with Qt toolkit:

  • pan tool enabled (crossing arrows button): the image is moved along the xmin-ymin/xmax-ymax diagonal (as explained by the OP)
  • zoom-in or zoom-out tool enabled: scrolling up is equivalent to zoom-in, scrolling down is equivalent to zoom-out

The latter is pretty much what I would expect (and what Gnuplot does if you add the CTRL key modifier), while the former is counter-intuitive. Maybe, in pan mode, scrolling could move up/down without modifier key and right/left with SHIFT modifier? That is what many drawing applications do and what Gnuplot does also.

Pantxo Diribarne <pantxo>
Project Member
Tue 05 Dec 2017 10:33:49 AM UTC, original submission:

If an image is shown in a Figure with imagesc an one uses the scroll wheel, the image moves diagonally from top left to bottom right an vise versa. The same happens if you push the scroll wheel to the left or right.

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #42582:  pan.patch added by pantxo (1KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by sebald (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by pantxo (Posted a comment)
  •  

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

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 07 Dec 2017 01:09:35 AM UTCrik5StatusPatch Submitted=>Fixed
      Open/ClosedOpen=>Closed
    Wed 06 Dec 2017 01:00:36 PM UTCpantxoAttached File-=>Added pan.patch, #42582
      StatusConfirmed=>Patch Submitted
    Tue 05 Dec 2017 02:06:22 PM UTCpantxoCategoryPlotting=>Plotting with OpenGL
      StatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup1