comparison events.pde @ 177:5e9ebac7e8e7

Cleanup and add a comment about sanity of one if() check.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 23 Aug 2018 13:02:14 +0300
parents 0940d991d3b0
children 934934bb1fbb
comparison
equal deleted inserted replaced
176:0940d991d3b0 177:5e9ebac7e8e7
695 } 695 }
696 696
697 if (g_data['t'] == 1 && ckey == 't') 697 if (g_data['t'] == 1 && ckey == 't')
698 message("Tile mode"); 698 message("Tile mode");
699 699
700 if (ckey == 'n') { 700 if (ckey == 'n' && g_data[int('n')] == 1)
701 if (g_data[int('n')] == 1) { 701 {
702 switcher(2); 702 switcher(2);
703 infersize(); 703 infersize();
704 if (g_data[int('n')] == 1) { 704
705 command(int('1')); 705 // infersize() may modify this, so check makes sense
706 command(int('9')); 706 if (g_data[int('n')] == 1)
707 g_data[int('p')] = 0; 707 {
708 g_data[int('x')] = 0; 708 command(int('1'));
709 g_data[int('y')] = 0; 709 command(int('9'));
710 g_data[int('q')] = 0; 710 g_data[int('p')] = 0;
711 g_data[int('t')] = 0; 711 g_data[int('x')] = 0;
712 } 712 g_data[int('y')] = 0;
713 g_data[int('q')] = 0;
714 g_data[int('t')] = 0;
713 } 715 }
714 } 716 }
715 717
716 if (g_data[int('i')] == 1) { 718 if (g_data[int('i')] == 1) {
717 g_data[int('i')] = 0; 719 g_data[int('i')] = 0;