diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2020-08-08 11:53:00 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2020-08-08 11:53:00 +0200 |
commit | b623f5953691b2a0614e6f1f4def86bdbb9a4113 (patch) | |
tree | 18102bd36f7e22eb2ba2b9f880e4cb29346f4cb8 /app/bin/cruler.c | |
parent | 359b557176b9bb2ff1aed2082641eed39c358d0d (diff) |
New upstream version 5.2.0Beta2.1upstream/5.2.0Beta2.1
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; } |