Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Clean Layer command #121

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MrOneTwo
Copy link
Contributor

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 MrOneTwo force-pushed the feature/add_clean_layer_command branch from 9f555f2 to defc363 Compare May 26, 2019 13:10
@Apostolique
Copy link

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

@MrOneTwo
Copy link
Contributor Author

@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.

@Apostolique
Copy link

I would use the words "Clear Layer" instead.

@serge-rgb
Copy link
Owner

@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.

@MrOneTwo
Copy link
Contributor Author

MrOneTwo commented Jul 9, 2019

@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.

@serge-rgb
Copy link
Owner

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants