Hot Door CORE Forum

Full Version: Odd tool event behavior
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
My plug-in does path editing.
It uses CORE mouse events (mouse dn, up, etc.)
Using mouse, dragging path object works.
But, hover mouse to a path object (anchor, segment, handle), with some key press, mouse down to convert, say corner anchor to smooth anchor, the effect is seen when the mouse still down, so far so good, as soon as mouse is up, the path returns to normal, as if an undo operation has occurred.
If after mouse down, immediately dragging the mouse, then release, the anchor got converted and dragged and correctly remained that way.

Is there anything in CORE that would cause this?
Prior to porting to core this behavior has never occurred.

Vincent
(03-12-2014, 12:25 PM)VincentDoan Wrote: [ -> ]My plug-in does path editing.
It uses CORE mouse events (mouse dn, up, etc.)
Using mouse, dragging path object works.
But, hover mouse to a path object (anchor, segment, handle), with some key press, mouse down to convert, say corner anchor to smooth anchor, the effect is seen when the mouse still down, so far so good, as soon as mouse is up, the path returns to normal, as if an undo operation has occurred.
If after mouse down, immediately dragging the mouse, then release, the anchor got converted and dragged and correctly remained that way.

Is there anything in CORE that would cause this?
Prior to porting to core this behavior has never occurred.

This largely has to do with the developer's own implementation of tool events, and in this case CORE is partially handling events for the developer so it has been setup for the most general situation possible.

In Illustrator, when some art is created by a plugin during e.g. a tool drag event, all the art that is generated with each event will "pile up" on top of art generated during prior events unless AIUndoSuite::UndoChanges() is called. Without the undo call, the "piled up" art will look horrible and bloat the artwork tree, but with the undo call everything looks and works great. I'm sure you already know about this issue. Smile

Some tools need to draw some sort of artwork "preview" during a mouse drag event, but then will draw the more complex/complete art once the mouse up event occurs. Therefore, CORE makes an undo call at the beginning of every mouse drag event and at the beginning of every mouse up event (before the developer's callback is called).

So, to remedy your problem, it is very likely that you simply need to perform the path modification(s) inside a mouse up callback as well as a mouse drag callback.
That's a great feature Garrett!
I think CORE will be extremely popular soon. I can't wait to use it in the near future.
For now, I am just porting my existing plug-in to CORE. It has been out and downloaded and used by many user already. One of the shout-out feature on my website is the ability to add, cut, insert, convert multiple path objects and drag using just one mouse click/drag operation. Lots of users gave feedback favoring that feature. I can't remove that feature Garrett. I hope you understand. The only way for me to keep this feature is to request that you add an option to not undo during any mouse event. I am sure future CORE users would appreciate this. For me, I always annotate a shape to be created, then construct the path afterward.
Looking forward to hear your response on this one. I really, really, really need this option.

Much thanks,

Vincent
(03-13-2014, 04:34 PM)VincentDoan Wrote: [ -> ]For me, I always annotate a shape to be created, then construct the path afterward.

CORE is implemented using the Adobe recommended method of drawing actual art during drag events and then immediately undoing the drawing. Then, perform one final draw on mouseUp. Drawing annotators during drag events is much more work. Please call me if you would like to talk more about this as it will be much easier to explain that way.

Brendon
I tried to modify my code to allow the undo mechanism CORE placed during mouse down, but no success.
The code I wrote 2 years go, vaguely remember why I did what I did, more complex than I remembered, sound familiar right? Well I have decided to stop before I do more damage. I do need the option to disable undo for mouse events. Please?

Have a great weekend,

Vincent