DrawUI icon indicating copy to clipboard operation
DrawUI copied to clipboard

Review updating strokes with incoming events

Open adamwulf opened this issue 5 years ago • 1 comments

In MMDrawModel near line 56:

            // TODO: It's possible for an update to come in for a previous stroke
            // after a new stroke has aleady been started. In that case, the
            // for loop below will never be run to find the correct stroke,
            // and the isSameTouchAsEvent: will also fail, causing the event
            // to be lost.

Also in [MMDrawnStroke addEvent:], all of the elements events were re-mapped into _eventIdToSegment instead of only elementEvents. Verify that using elementEvents is enough.

adamwulf avatar Feb 23 '20 20:02 adamwulf

I think the correct strategy is to check for existing stroke's waitingForEvent: immediately if either !strokeForEvent or [[strokeForEvent event] isSameTouchAsEvent:event]. This way a stroke is found if the current active stroke isn't a match as well.

adamwulf avatar Feb 23 '20 20:02 adamwulf