Menu

#9 On GTK2 there are odd jumps when starting a swipe while the mouse is still moving

1.0
closed
nobody
None
2020-10-19
2020-10-11
prof7bit
No

On GTK the mouse down event will (sometimes? always?) come after the first mouse move event with ssleft. If I press the left mouse button while it is still moving (even slowly) it will start the swipe with a totally wrong down_x and down_y. The result is a jump of the image across the entire screen and total loss of orientation. I have to zoom out and find the area again.

I have hacked together a quick fix that appears to work for me:

I have introduced a flag down_xy_valid that gets set in the mouse down event and gets reset in the mouse up event and also gets reset whenever a mouse move without ssleft is encountered (this will probably need some testing on other platforms). Swipe will only happen when ssleft AND down_xy_valid are both active.

PS: I have witnessed the same behavior (jumping when pressing the mouse while moving) in hnsky, it is probably using the same logic.

1 Attachments

Discussion

  • han.k

    han.k - 2020-10-11

    Thanks for this excellent detective work. Yes it fixes it.

    HNSKY suffers from a similar problem.

    Normally I work in the Windows environment I haven't noticed this behavior or ignored it as a glitch. Linux is for me virtual machine mainly to compile and for a little testing only.

    Something else. I like to have you opinion about an other possible improvement. I have made in the past an ASTAP version with two Timage displayed. So a version where two images could be shown at the same time. Could even be more Timages. You could move them around like forms or windows and zoom in/out the one having focus. One of the ideas was to make one transparant and be able to overlay them. Transparency was not achieved and I wasn't fully happy with the interface so I abandoned that idea. But I'm still considering to try it again.

    Han

     

    Last edit: han.k 2020-10-11
  • prof7bit

    prof7bit - 2020-10-11

    I am currently working on another fix for the extremely poor paint performance of the TImage on GTK2. You might already have noticed it during testing: the further you zoom in the slower it becomes. The reason for this is it will clip the image after scaling it up. I have made a descendant of TImage with a rewritten paint method that will first determine the visible area and then only scale and copy that part of the image.

    Maybe I will try to see whether this can also be made transparent but I would not want to promise anything, it will probably also be highly dependent on the wigetset.

     

    Last edit: prof7bit 2020-10-11
  • han.k

    han.k - 2020-10-19
    • status: open --> closed
     

Log in to post a comment.