MakieOrg / Makie.jl

Interactive data visualizations and plotting in Julia
https://docs.makie.org/stable
MIT License
2.38k stars 302 forks source link

Possible code error on Make website about events #3714

Open oniehuis opened 6 months ago

oniehuis commented 6 months ago

I am not sure if this is the right place to post this kind of information. However, I think I found a bug in the sample codes for events on the Make website (https://discourse.julialang.org/t/is-repeat-mousebutton-action-implemented-in-makie/111647). Starting with the second example code on mouse interaction, the provided example codes check for the condition "mb.action == Mouse.repeat". However, Mouse.repeat does not seem to be implemented and has no effect. The sample codes work fine if the condition "mb.action == Mouse.repeat" is removed from all code examples.

ffreyer commented 5 months ago

You're right, Mouse.repeat doesn't exist: https://github.com/MakieOrg/Makie.jl/blob/1d504055c179f1f005d9dc78ced8ddfddfd3e77c/src/interaction/iodevices.jl#L187-L190 It should just check if the last mouse button event was a left-press. Or perhaps if Mouse.left in events(scene).mousebuttonstate so you can right click without committing the placement. That would also be a good way to introduce that state field.