[longbow-project] [PATCH] Added Space as key for setting/unsetting pixels

  • From: K T <greenfoxlight.42@xxxxxxxxx>
  • To: longbow-project@xxxxxxxxxxxxx
  • Date: Fri, 12 Jun 2015 15:48:04 +0200


From 4c3e5785664090895bf60e96ec0eeeeb9fc28400 Mon Sep 17 00:00:00 2001
From: Kevin Trogant <greenfoxlight.42@xxxxxxxxx#>
Date: Fri, 12 Jun 2015 15:42:33 +0200
Subject: [PATCH] Font-Creator: Added 'Space' as key for setting/unsetting
pixels

---
util/font_creator/src/font/edit_chr.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/util/font_creator/src/font/edit_chr.c
b/util/font_creator/src/font/edit_chr.c
index 6175536..523d65f 100644
--- a/util/font_creator/src/font/edit_chr.c
+++ b/util/font_creator/src/font/edit_chr.c
@@ -21,7 +21,7 @@ void font_edit_chr(struct font_chr_info* chr, struct font*
font) {
mvprintw(0, 0, "Editing character %d (0x%x)", chr->code,
chr->code);
_display_mtrx(1, 0, chr);
mvaddch(y+1, x, 'C');
- mvprintw(17, 0, "Keys: Move cursor Enter: set/unset pixel q:
Save and Exit");
+ mvprintw(17, 0, "Keys: Move cursor Space/Enter: set/unset
pixel q: Save and Exit");
in = getch();
switch (in) {
case KEY_UP:
@@ -36,6 +36,7 @@ void font_edit_chr(struct font_chr_info* chr, struct font*
font) {
case KEY_RIGHT:
x = (x < (CHR_MATRIX_WIDTH - 1)) ? x + 1: x;
break;
+ case ' ':
case '\n':
if (chr->matrix[y * CHR_MATRIX_WIDTH + x] ==
CHR_MATRIX_UNSET) {
chr->matrix[y * CHR_MATRIX_WIDTH + x] =
CHR_MATRIX_SET;
--
1.9.1

Other related posts:

  • » [longbow-project] [PATCH] Added Space as key for setting/unsetting pixels - K T