Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

8. Gestures and Touches > Retaining Touch Paths

Retaining Touch Paths

Recipe 8-13 erased old paths at the end of their life cycle. That worked well for application bookkeeping but failed when it came to creating a standard drawing application, where you expect to iteratively add elements to a picture. You can easily adapt its drawing code base to continue adding traces into a composite picture without erasing old items, as is shown in Recipe 8-14.

To extend your multitouch path dictionary beyond the lifetime of a single touch, be prepared to create new keys for your existing Bezier paths. That’s an important step because of one simple fact: memory gets re-used. A touch that maps to a given address as its key may be overwritten once the user removes that touch from the screen and a new touch begins. You can fix this minor stumbling block by creating new unique keys that won’t conflict with other items in your touch dictionary.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint