fixed selection in the color dialog

This commit is contained in:
Zeno Rogue 2018-01-25 23:47:13 +01:00
parent 0ffec1975c
commit c79037088f
1 changed files with 2 additions and 2 deletions

View File

@ -428,11 +428,12 @@ namespace dialog {
unsigned char* pts = (unsigned char*) &color;
pts[uni - 'A'] = x;
}
else if(uni == ' ') {
else if(uni == ' ' || uni == '\n') {
bool inHistory = false;
for(int i=0; i<10; i++) if(colorhistory[i] == (unsigned) color)
inHistory = true;
if(!inHistory) { colorhistory[lch] = color; lch++; lch %= 10; }
if(reaction) reaction();
popScreen();
}
else if(uni >= '0' && uni <= '9') {
@ -456,7 +457,6 @@ namespace dialog {
pts[colorp] += abs(shiftmul) < .6 ? 1 : 17;
}
else if(doexiton(sym, uni)) {
if(reaction) reaction();
popScreen();
}
return false;