You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To reproduce just unzip the archive in your b4w project directory. Open the anchor_bug.html from the project manager. Click to different points on the anchor fixed black divs (I disabled the pointer events on them), and on certain mouse positions the anchors will be picked instead of the cubes, you will see it in the js console. Of course the error also occurs when you click next to a div.
I found the cause and made a dirty fix or workaround, however I did not spend enough time on it, so it is possible that this change will disable some other functionality:
@@ -1749,11 +1749,6 @@ exports.pick_object = function(canvas_x, canvas_y) {
return null;
}
- var anchor = m_anchors.pick_anchor(canvas_x, canvas_y);
-
- if (anchor)
- return anchor;
-
var color = m_scenes.pick_color(main_scene, canvas_x, canvas_y);
if (!color)
My suggestion is that anchor picking code should be separated from the pick_object function to its own function to avoid confusions like this.
The text was updated successfully, but these errors were encountered:
I ran into an esoteric bug:
Custom element anchors were picked by pick_object(x, y) from the scene module using version 16.12.1. on GNU/Linux (which I guess is not relevant)
This bug was also experienced by at least one other person, see this post
I made a self-contained example:
example
To reproduce just unzip the archive in your b4w project directory. Open the anchor_bug.html from the project manager. Click to different points on the anchor fixed black divs (I disabled the pointer events on them), and on certain mouse positions the anchors will be picked instead of the cubes, you will see it in the js console. Of course the error also occurs when you click next to a div.
I found the cause and made a dirty fix or workaround, however I did not spend enough time on it, so it is possible that this change will disable some other functionality:
My suggestion is that anchor picking code should be separated from the pick_object function to its own function to avoid confusions like this.
The text was updated successfully, but these errors were encountered: