serge-rgb / milton

An infinite-canvas paint program
GNU General Public License v3.0
1.53k stars 133 forks source link

Feature Request: Pins / Saved Locations #116

Open crhallberg opened 5 years ago

crhallberg commented 5 years ago

It would be really excellent if I could save or pin locations around the infinite canvas to make things easier to find. Saving the camera location and zoom under a name that could be pulled back up later is what I'm looking for.

I'd be happy to help contribute this but I'll need a few pointers on where to fit this into the code, I'm still a beginner when it comes to large C project coding.

serge-rgb commented 5 years ago

Hmmm... The Milton GUI is in gui.cc. So I would start there, writing the usage code and stubbing out the interface. You would probably want to look at the CanvasView structure (defined in canvas.h). This feature would require Milton to store a list of CanvasViews instead of a single one. Currently the single CanvasView is allocated and stored as a pointer in the Milton struct, defined in milton.h

Once that is working, you need to save it out to memory. This is done in persist.cc. Look for CanvasView and in that file to see how it's saved out.

Let me know if you do end up giving it a shot at implementing this. I can answer questions through here 👍

crhallberg commented 5 years ago

Thanks! I'll start slowly poking at this.