webfactorymk/ng2-canvas-whiteboard

Question: Exposing _updateHistory?

Closed this issue · 6 comments

Hi,

First of all great works.

Secondly I have a question: my use case requires me to save the drawings as a list of history as oppose to an image or a blob. Do you think its an acceptable idea to expost _updateHistory in canvas-whiteboard.component?

Thanks!

Hi sir, if it works for you i could make a method to expose a deep copy of the update history since i would not want anyone else mutating it by exposing it directly? You would get the same feature but changing it yourself will not affect the canvas midway, making it readonly for you

Thanks for the quick reply! I think that make a lot of sense...wouldn't want anyone to mess with the private one.

Ultimately I just need to be able to store the drawings as a JSON array of events and the ability to replay them when necessary.

Once again thanks!

Yeah, that is why i am outputting batchSignals as well but i guess it shouldnt be an issue to just change rhe reference of the history and send it all at once, let me do some research, test everything and i think we can complete this enhancement. Just need to check the coordinate mapping so that everything is okay upon redraw when you get them back from the db

Hey sir,

I've pushed version 2.1.2 if you are not working with an Angular 6 project, and version 3.0.3 if you are working with Angular 6. Please test the library, try it out and tell me if it all works.

That's exactly what I need. Once again thank you sir for your help and efforts.

Cheers