diff options
Diffstat (limited to 'app/bin/cruler.c')
-rw-r--r-- | app/bin/cruler.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/app/bin/cruler.c b/app/bin/cruler.c index b1addc6..d3f2926 100644 --- a/app/bin/cruler.c +++ b/app/bin/cruler.c @@ -62,43 +62,34 @@ static STATUS_T CmdRuler( wAction_t action, coOrd pos ) case C_START: switch (Dr.state) { case DR_OFF: - DrawRuler( &tempD, Dr.pos0, Dr.pos1, 0.0, TRUE, TRUE, wDrawColorBlack ); Dr.state = DR_ON; InfoMessage( "%s", FormatDistance( FindDistance( Dr.pos0, Dr.pos1 ) ) ); break; case DR_ON: - DrawRuler( &tempD, Dr.pos0, Dr.pos1, 0.0, TRUE, TRUE, wDrawColorBlack ); Dr.state = DR_OFF; break; } - MainRedraw(); return C_CONTINUE; case C_DOWN: - if (Dr.state == DR_ON) { - DrawRuler( &tempD, Dr.pos0, Dr.pos1, 0.0, TRUE, TRUE, wDrawColorBlack ); - } Dr.pos0 = Dr.pos1 = pos; Dr.state = DR_ON; - DrawRuler( &tempD, Dr.pos0, Dr.pos1, 0.0, TRUE, TRUE, wDrawColorBlack ); InfoMessage( "0.0" ); - MainRedraw(); return C_CONTINUE; case C_MOVE: - DrawRuler( &tempD, Dr.pos0, Dr.pos1, 0.0, TRUE, TRUE, wDrawColorBlack ); Dr.pos1 = pos; - DrawRuler( &tempD, Dr.pos0, Dr.pos1, 0.0, TRUE, TRUE, wDrawColorBlack ); InfoMessage( "%s", FormatDistance( FindDistance( Dr.pos0, Dr.pos1 ) ) ); - MainRedraw(); return C_CONTINUE; case C_UP: inError = TRUE; - MainRedraw(); return C_TERMINATE; case C_REDRAW: + if (Dr.state == DR_ON) { + DrawRuler( &tempD, Dr.pos0, Dr.pos1, 0.0, TRUE, TRUE, wDrawColorBlack ); + } return C_CONTINUE; case C_CANCEL: @@ -126,21 +117,22 @@ STATUS_T ModifyRuler( return C_ERROR; } case C_MOVE: - DrawRuler( &tempD, Dr.pos0, Dr.pos1, 0.0, TRUE, TRUE, wDrawColorBlack ); if ( Dr.modifyingEnd == 0 ) { Dr.pos0 = pos; } else { Dr.pos1 = pos; } - DrawRuler( &tempD, Dr.pos0, Dr.pos1, 0.0, TRUE, TRUE, wDrawColorBlack ); InfoMessage( "%s", FormatDistance( FindDistance( Dr.pos0, Dr.pos1 ) ) ); - MainRedraw(); return C_CONTINUE; case C_UP: return C_CONTINUE; + case C_REDRAW: + DrawRuler( &tempD, Dr.pos0, Dr.pos1, 0.0, TRUE, TRUE, wDrawColorBlack ); + break; default: return C_ERROR; } + return C_CONTINUE; } |