milton icon indicating copy to clipboard operation
milton copied to clipboard

Add Clean Layer command

Open MrOneTwo opened this issue 6 years ago • 6 comments

I've added a "Clean layer" command which cleans the active layer.

What needs fixing is that the buffer gets updated when a new stroke is being dropped. That's a bad UX. @serge-rgb Is there an update buffer function?

MrOneTwo avatar May 26 '19 13:05 MrOneTwo

What does it meant to clean a layer? It optimizes the strokes?

Apostolique avatar May 26 '19 13:05 Apostolique

@Apostolique It deletes the strokes from the layer. Thought it might be useful instead of erasing strokes by hand. You can also delete a layer and create a new one but cleaning might be useful too.

MrOneTwo avatar May 26 '19 16:05 MrOneTwo

I would use the words "Clear Layer" instead.

Apostolique avatar May 26 '19 21:05 Apostolique

@MrOneTwo You can make milton redraw the screen by doing input->flags |= MiltonInputFlags_FULL_REFRESH; right before or after calling milton_wipe_layer().

Just a couple notes:

  • There should be a confirmation prompt before actually clearing the layer, since it's a destructive and non-undoable action.
  • I agree that it should be called "clear" rather than "clean". "Wipe" also works (and it matches the code).
  • Ctrl-C binding should probably be something else. Stroke copy/cut/paste is in the horizon and Ctrl-C/X/V are the usual bindings for those operations. I'm a little hesitant to even add a default binding for this command. I think by default it should simply be a menu option, and the user can optionally bind it to something. My thinking is that for many (most?) workflows wiping the layer should be a relatively rare occurrence.

serge-rgb avatar May 27 '19 00:05 serge-rgb

@serge-rgb I agree that it probably shouldn't be binded by default. I don't agree with a prompt, but that's because I hate prompts :P I would say that having it as a menu option and no default binding would make a prompt unnecessary...? I really dislike when software treats users like children. I do understand there are cases when the user presses the thing on a long list of options... I think Milton is great as a whiteboard. It's common you start drawing something and either it didn't come on correctly or you just don't like the direction it's going. You wipe the layer and start over. I'll think about making it mistakes resilient and convenient.

I will use input->flags, use clear or wipe and remove the default binding. I'll also add it as a menu option.

Sorry it takes me ages to do anything... I really like Milton and I think it can be something special (better Mischief and FOSS). I'll try to bring some more goodies soon.

MrOneTwo avatar Jul 09 '19 13:07 MrOneTwo

If some operation performs a non-undoable action, it should have a prompt. I agree that prompts suck though, so maybe the right thing is to make it so that wiping the layer is undoable.

Also, no need to apologize. I appreciate anyone who gives some of their free time to contribute to Milton :)

serge-rgb avatar Jul 14 '19 18:07 serge-rgb