blocktronics / moebius

Modern ANSI & ASCII Art Editor
https://blocktronics.github.io/moebius/
Apache License 2.0
734 stars 40 forks source link

Implement layers #148

Open bart-d opened 4 years ago

bart-d commented 4 years ago

I would like to get an idea of the feasbility of a layers/pages feature. Early editors like TheDraw and ACiDdraw already supported so-called 'pages' at the time and such a feature would be great aid to composition.

Even the most simplistic implementation which those old editors used would be useful

andyherbert commented 4 years ago

I've always reserved this as a 2.0 feature because it would ideally be addressed alongside a rewrite. Currently the 'canvas' is, frankly, a jumbled mess of absolutely-positioned HTML elements and badly written CSS, instead of what ideally should be represented internally as multiple byte-array buffers, and written to the DOM only when needed. When I've experimented with adding more layers to the current system it chokes Chromium, which isn't too surprising because javascript engines are heroically fast right up until they have to interact with the DOM. This is incidentally also why magnification can't just simply be applied to the canvas instead of the entire window - something that probably frustrates me more than anyone. I do have my doubt how useful layers might ultimately be, but in an ideal world I would like someone to hand the writing of HTML and CSS over to someone else, which has always been a hassle for me, and wait for the right time to implement something that I think would require big changes. I don't necessarily mind big changes unless I can fix a lot of things at the same time, and for a 1.0 release I wanted to produce something that could reasonably be considered as a replacement for Pablo.

bart-d commented 4 years ago

Quite sure it would be useful. I myself waste the most time on integrating things. currently when i want 2 things combined together, i take move them into place line by line, taking only a fragment of the line that doesn't overlap the other object. and when i finish doing that and realize the composition isn't all that, it have to start over, it's quite tedious. copy over/under which is somewhat the principle of a layer doesn't fix that, as it merges overlapping bits, a layer would fix that as one could still erase under or above the overlap. Even just 2 layers would already be quite a useful addition.

Based on your feedback, i get the idea that anything that sort of matches PabloDraw's features would be intended for version 1.0 and anything entirely new should belong in version 2.0. We could go and make a GH project and park those feature in different projects to keep track of them. Didn't use it before but looks workable.

tbh, i didn't look yet on how the vanavs is rendered but i do share the concern for performance in any case. but you're not alone with the canvas zooming issue, I prefer to draw at 200%, i get rid of the preview to get there without having scrollbars on the canvas :)

andyherbert commented 4 years ago

If someone wants to go ahead and make a repo so we can do some 'blue-sky thinking' on Moe 2 then invite me over, I've got quite a few ideas stored up.

bart-d commented 4 years ago

Does it need to be a seperates repo, wouldn't a branch suffice?

andyherbert commented 4 years ago

I am unable to do that because of the absurd way privileges are set up for this repo.

ollipelkonen commented 3 years ago

Not exactly the same, but I spent several evenings to add animation support to Moebius (even though i've always hated animated ansis). Another frames could be used as a separate page, but saving it will save all frames as animated ansi. https://github.com/ollipelkonen/moebius/tree/animation I probably should add "save current frame" and "save animated ansi" options.

Maybe that'd also be used to create layer support, but not too easily. Oh, and I never tried that with server, it will most likely do something really interesting. Also, my code is full of strange hacks to bypass some deeply rooted mechanisms in Moebius :)