diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2020-08-24 21:26:53 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2020-08-24 21:26:53 +0200 |
commit | df247efec654e512242e4f4f1b0212034f9e01fe (patch) | |
tree | 25c02e16957f3aa613af30c140fd8e8a3d52fda6 /app/bin/cruler.c | |
parent | d0b6a8a4ec298024f14f704f9e40a6f9d324ccf3 (diff) | |
parent | a5ade52caa489cf0a713e0f02b764000d203140e (diff) |
Merge branch 'release/debian/1%5.2.0Beta2.1-1' into masterdebian/1%5.2.0Beta2.1-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; } |