Bug when Adding Point and hitting Undo at the same time

Discuss Moho bugs (or suspected bugs) with other users. To report bugs to Smith Micro, please visit support.smithmicro.com

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
DrNibbert
Posts: 51
Joined: Tue Jun 19, 2018 7:48 am

Bug when Adding Point and hitting Undo at the same time

Post by DrNibbert »

Hello,

i produced an interessting Error today:
I was in the Add Point-Tool (Auto-Weld, Auto-Fill, Auto-Stroke, Sharp Corners - All settings enabled) and was click-dragging to create a new line, while at the same time pressing Cmd+Z to undo the Point i did before, while still holding the Left Mouse Button Pressed. This resulted in the Colsole popping up and spitting out the error-message
M_Mesh:Point - out of range
...Contents/Ressources/Support/scripts/tool/lm_add_point.lua:319: attempt to index a nil value
over and over.

i had to quit and restart Moho to continue working.

I was able to reproduce this error in a new Project with the same settings.
Showreel 2018 https://vimeo.com/254290989 - Moho 12.5.1, macOS 10.10, Adobe CS6
User avatar
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Bug when Adding Point and hitting Undo at the same time

Post by synthsin75 »

The tool has to count through all the points to find the one to connect to and the one you're adding (while you're deciding where to place it). If you hit undo in the middle of a mouse operation, you are changing the number of points, and functions that expect that number to remain valid throw errors.

If someone were to try to account for the user hitting undo in the middle of a mouse operation, it would require more processing while you're moving the mouse, which would likely make it slower to respond, especially with more points on the layer. There's nothing that hitting undo in the middle of a mouse operation can do that just waiting til after you let off the mouse button can't. So refraining from doing that is a small price to pay for a tool that responds quickly and smoothly.

If the error keeps repeating either change tools, hit undo again, or add a new point. Then the error will stop repeating and you can just close the Lua Console and continue working, without quitting Moho. That error is not a danger to your file.
DrNibbert
Posts: 51
Joined: Tue Jun 19, 2018 7:48 am

Re: Bug when Adding Point and hitting Undo at the same time

Post by DrNibbert »

Thanks! Wasn't really a big problem for me, just wanted to bring it to everyones attention so maybe this can be fixed in a future update :-)
Showreel 2018 https://vimeo.com/254290989 - Moho 12.5.1, macOS 10.10, Adobe CS6
User avatar
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Bug when Adding Point and hitting Undo at the same time

Post by synthsin75 »

Actually, with a little further thought, this could be fixed without impacting performance: https://sites.google.com/site/synthsin/ ... ects=0&d=1

I'll report it, and this fix, to the devs.
DrNibbert
Posts: 51
Joined: Tue Jun 19, 2018 7:48 am

Re: Bug when Adding Point and hitting Undo at the same time

Post by DrNibbert »

Awesome :-) I feel like every tiny addition makes Moho better and better every day :D
Showreel 2018 https://vimeo.com/254290989 - Moho 12.5.1, macOS 10.10, Adobe CS6
Post Reply