musicblocks icon indicating copy to clipboard operation
musicblocks copied to clipboard

sticky boolean blocks

Open walterbender opened this issue 3 years ago • 4 comments

Nathan found that sometimes you cannot drag a boolean block. After experimenting, we found that you could drag the block from the top. I suspect that the "hit area" is not being calculated properly when a boolean block resizes.

walterbender avatar Oct 01 '21 21:10 walterbender

Hey @walterbender, Can I work on this issue.

Can you please elaborate more on the issue

nikkuAg avatar Jan 13 '22 13:01 nikkuAg

I cannot seem to reproduce this issue. But it presumably was related to a misconfigured or corrupted hit area for the drag event.

walterbender avatar Jan 14 '22 02:01 walterbender

@walterbender After testing extensively, I've figured out how to easily reproduce this issue and have a decent hypothesis as to why:

image As shown in the above image, when connecting a number block other than the simple digit to the top notch of a boolean block, the block resizes to visually accommodate. However, when resizing, the hit area for the drag event does not resize with it, regardless of the amount resized. As the picture shows, the cursor is on the block just under the size that the inital boolean would be, and the block cannot drag (the cursor also does not have a click icon, showing that it's not in the hit area to select the block).

image Here is another example, neither block allows dragging at cursor level, both allow it just above that level

After the case above, I also managed to get that selection area to be even less by overwhelming the resizing process. If you move a resized block from the top notch to the bottom one, the outer block resizes (leaving the block floating for a moment), thinks about it, and then snaps the block into place. Doing this along with other resizing seems to allow for smaller hit areas to be created, although I have not entirely figured out why or how small we can go (initial thought based on the next picture is that the equal block got confused and the hit box is the size of a single line number block). dragging from the top of the block seems to reset the hit area to the regular initial size in these cases, though:

image

Let me know if this is sufficient information to move forward with fixing it!

avimikhli avatar Apr 20 '22 05:04 avimikhli

Your diagnosis seems correct. Thx.

walterbender avatar Apr 20 '22 11:04 walterbender