Closed 0x0ade closed 6 years ago
Oh shit, I was actually working exactly on this.
Oops 😅 I guess I'll close this PR then
WAIIIIIIIIIIIT
Give me a minute, I'm thinking.
Okay, since you got this far... How much more work do you think it would be to use this system to make a .dot file with the json on export. And allow this .dot file to be loaded back into the canvas?
Working on it :)
To keep things easy for now (I don't know where to place a "load" button 😅), exporting will save a .dot next to the .png and .svg; opening will be done via drag-n-drop or via CTRL + O. Does that sound okay?
Yeah, don't add a load button.
Okay, I've got rid of my stuff and merged so I can complete my work on the zoom feature.
I've just finished my .dot save & load work T.T
Send away :) I ll merge with my stuff and push it.
This PR adds some basic serialization and copy - paste functionality.
Copying puts a serialized, plain-text representation of the image and a
text/svg+xml
representation in your system's clipboard. Unfortunately putting files into the system clipboard doesn't work at the moment (see https://bugs.chromium.org/p/chromium/issues/detail?id=504700), so I'm resorting totext/svg+xml
. It's the same, except for storing the SVG as plain-text (similar totext/html
), not as file.This allows copying from Dotgrid and immediately pasting into rotonde:
The serialized result uses arrays instead of objects to keep clutter to a minimum:
This could also be used to save Dotgrid "project" files.