Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undo functionality takes time #12

Open
Rao27 opened this issue Dec 20, 2013 · 3 comments
Open

Undo functionality takes time #12

Rao27 opened this issue Dec 20, 2013 · 3 comments

Comments

@Rao27
Copy link

Rao27 commented Dec 20, 2013

Your code works perfectly for me. But when i draw so much data at that time undo function take exponential time depends on the content draw on the drawing pad. How can i reduce that time while undoing? I don't know how much time undo function take when it is called because it is dependent on total content.

@acerbetti
Copy link
Owner

When you undo the latest step, this is what is happening:

  1. the cache image is erased
  2. every path in the undo array will be redrawn, but the last one

One suggestion to improve the performances could be to save more than one cache image, let say once every 10 draws. Doing this, when you undo, you will redraw only up to 9 items ...

@Rao27
Copy link
Author

Rao27 commented Dec 20, 2013

saving extra cache image is good way to solve but if 1 of the ten draw is too big then it will take much time. Can we update cache image every time, and when undo is pressed it will just replace last image.

@Rao27
Copy link
Author

Rao27 commented Dec 24, 2013

Done with Undo time gap.

I have one doubt regarding this. Hope this is not the wrong place to ask. I apologize if it is.

I am developing one application in which i will let user to draw a picture, after user completes drawing i will display the video how user did that. So gradually it will redraw complete drawing. I am done with this part but i am stuck with fast forward functionality. In which user will directly see final drawing. So how can i implement that. I have developed code for that and it works fine with simulator but i am facing problem in device as application crashes when i click on that button. I think reason is in device we can not render too much data with one click at the same time.

Can you guide with this?
Please give some idea if you have on this, will try to implement that.

-Thanx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants