gwu.Event.Mouse() returns wrong values

30 views
Skip to first unread message

lunasy...@gmail.com

unread,
Sep 30, 2018, 12:46:26 PM9/30/18
to gowebuitoolkit
Hello,

in my attempts of learning Go, I stumbled over gowut. It looks very interesting for me and I tried to build
a little example of my own. The main goal was to display a rendered picture of the mandelbrot set, with the
ability to edit the specific parameters to render a new picture. Therfore I also try gathering the coordinates
of the mandebrot set while moving with the mouse cursor over the image.
But here I found that the coordinates returned by gwu.Event.Mouse() seems not correct, if the image is greater then the view port in the browser.

For example:
After runing the example code, the window in the browser shows a panel which contains an editable field.
Below this panel I placed a second panel for the image.
I get the correct coordinates of the left upper corner of the image,
also the coordinates of the lower right corner of the image within the viewport (without scrolling) are ok,
but when I scroll down to the real lower right corner of the image and check the coordinates, the returned y-value is wrong, its still
the same as before scrolling. If you move the mouse in the upper area of the image (without scrolling), the y-value
decrease and will change at least into a negativ value, if you move far enough.
I would expect, that regardless of srolling, the coordinates returned while clicking into the image should be within the range of the image size. Please let me know if I am wrong, or if its an issue with gowut.

I have attached my go program.

Thanks!

main.go

András Belicza

unread,
Oct 1, 2018, 6:31:18 AM10/1/18
to lunasy...@gmail.com, gowebuitoolkit
Thanks for reporting this, you are totally right.

The amount the body is scrolled is not taken into account.

I've already fixed this in https://github.com/icza/gowut/commit/3775ac0048af8d7951986c1170a447c4e5353e5c, but is only available on the dev branch.

Will go live in the next pub release.

lunasy...@gmail.com

unread,
Oct 1, 2018, 12:49:46 PM10/1/18
to gowebuitoolkit
Hi,

thank you very much for the quick response:)
Is there a schedule when the next pub release will go live?

Best regards ...

András Belicza

unread,
Oct 1, 2018, 4:02:49 PM10/1/18
to lunasy...@gmail.com, gowebuitoolkit
There is no schedule, but last version was quite some time now, and there are few additions / fixes that warrant a new release. I'll probably get on it tomorrow.

András Belicza

unread,
Oct 2, 2018, 5:19:10 PM10/2/18
to lunasy...@gmail.com, gowebuitoolkit
Gowut v1.4.0 has been released.

Bests,
Andras
Reply all
Reply to author
Forward
0 new messages