painter2 icon indicating copy to clipboard operation
painter2 copied to clipboard

Save painter2 drawings infomation

Open aldwnesx opened this issue 4 years ago • 6 comments

Hi, first of all thanks so much for this library.

I am making a drawing app, and I would like to be able to save and load different paintings.

Which properties should I save and how can I load them?

aldwnesx avatar Mar 04 '20 04:03 aldwnesx

Hi,

Thank you :)

You would need to modify the code from this plugin. I think for that purpose your best choice is to save the _PathHistory instance from the PainterController class.

I don't have time right now to implement that in the library, but you can do it yourself. And, if you achieve it and want to share it, PRs are welcome. And i will give all credit to you :)

ja2375 avatar Mar 04 '20 08:03 ja2375

I amble to restore deleted drawings successfully thanks to your tips.However I'm not sure if I did it in the proper/best way in coding standards.. Currently everything is stored in list in memoery and I'm not sure how I can store the list of Path objects in database or storage

aldwnesx avatar Mar 09 '20 14:03 aldwnesx

I am not sure what properties should be stored and created when loading the drawing/sketch.

Such as points are stored, but how do we know if it's supposed to be a striaght line or square?

aldwnesx avatar Mar 09 '20 16:03 aldwnesx

I did this code changes in the my fork of this repo, so one can store and load drawing using _PathHistory.

Can we probably merge it in a pull request?..

fellow7000 avatar Nov 01 '20 10:11 fellow7000

Sure! Just submit that PR and i will merge it.

ja2375 avatar Nov 02 '20 10:11 ja2375

The problem is, I can not make this pull request: Github is saying, both branches are totally different :-/ I cannot understand, why, actually I did it once for another feature, but now it does not work.

Any idea on that?.. You can have a look here: https://github.com/fellow7000/painter2

fellow7000 avatar Nov 03 '20 21:11 fellow7000