If you move a picker onto a black area of the image, the picker doesn't
stand out against the background. This makes it easy to lose pickers in
black areas and difficult to pick them up again.
This change adds an alternative method of moving pickers. Even if you
can't find the picker to click on it with the mouse, you can press the
corresponding keyboard key to grab and move it to your mouse cursor.
---
This fixes a typo that was in the commit message of my first patch.
README.md | 1 +
dito.c | 6 +++++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 0cddc97..2c1cf35 100644
--- a/README.md
+++ b/README.md
@@ -33,3 +33,4 @@ To open a bitmap:
### Paint
- `mouse1` Move Picker
+- `1234` Pick up Picker 1-4. `mouse1` to drop.
diff --git a/dito.c b/dito.c
index 484fe19..e29ce01 100644
--- a/dito.c
+++ b/dito.c
@@ -422,7 +422,7 @@ domouse(SDL_Event *event)
DOWN = 1;
break;
case SDL_MOUSEMOTION:
- if(DOWN && selected)
+ if(selected)
setpicker(selected, event->motion.x / ZOOM - PAD * 8, event->motion.y / ZOOM - PAD * 8);
break;
}
@@ -442,6 +442,10 @@ dokey(SDL_Event *event)
} else {
switch(event->key.keysym.sym) {
case SDLK_SPACE: savemode(&COLORS, !COLORS); break;
+ case SDLK_1: selected = &pickers[0]; break;
+ case SDLK_2: selected = &pickers[1]; break;
+ case SDLK_3: selected = &pickers[2]; break;
+ case SDLK_4: selected = &pickers[3]; break;
}
}
}
--
2.27.0