summaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
authorVojtech Bocek <vbocek@gmail.com>2015-03-15 15:25:37 +0100
committerDees Troy <dees_troy@teamw.in>2015-03-19 16:41:47 +0100
commite8c39274610dc0a92c00d6e01c31434e6afdebfb (patch)
treee0ffd4699e9410b4e96ea5585842a0cad9b83351 /gui
parentMerge "Revert "Force sync files written by minzip."" into android-5.1 (diff)
downloadandroid_bootable_recovery-e8c39274610dc0a92c00d6e01c31434e6afdebfb.tar
android_bootable_recovery-e8c39274610dc0a92c00d6e01c31434e6afdebfb.tar.gz
android_bootable_recovery-e8c39274610dc0a92c00d6e01c31434e6afdebfb.tar.bz2
android_bootable_recovery-e8c39274610dc0a92c00d6e01c31434e6afdebfb.tar.lz
android_bootable_recovery-e8c39274610dc0a92c00d6e01c31434e6afdebfb.tar.xz
android_bootable_recovery-e8c39274610dc0a92c00d6e01c31434e6afdebfb.tar.zst
android_bootable_recovery-e8c39274610dc0a92c00d6e01c31434e6afdebfb.zip
Diffstat (limited to 'gui')
-rw-r--r--gui/patternpassword.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/gui/patternpassword.cpp b/gui/patternpassword.cpp
index 4fc781298..ed152851f 100644
--- a/gui/patternpassword.cpp
+++ b/gui/patternpassword.cpp
@@ -226,19 +226,24 @@ void GUIPatternPassword::ConnectIntermediateDots(int dot_idx)
return;
const int last_dot = mConnectedDots[mConnectedDotsLen-1];
+ int mid = -1;
// The line is vertical and has crossed a point in the middle
- if(dot_idx%3 == last_dot%3 && abs(dot_idx - last_dot) > 3)
- ConnectDot(3 + dot_idx%3);
+ if(dot_idx%3 == last_dot%3 && abs(dot_idx - last_dot) > 3) {
+ mid = 3 + dot_idx%3;
// the line is horizontal and has crossed a point in the middle
- else if(dot_idx/3 == last_dot/3 && abs(dot_idx - last_dot) > 1)
- ConnectDot((dot_idx/3)*3 + 1);
+ } else if(dot_idx/3 == last_dot/3 && abs(dot_idx - last_dot) > 1) {
+ mid = (dot_idx/3)*3 + 1;
// the line is diagonal and has crossed the middle point
- else if((dot_idx == 0 && last_dot == 8) || (dot_idx == 8 && last_dot == 0) ||
- (dot_idx == 2 && last_dot == 6) || (dot_idx == 6 && last_dot == 2))
- {
- ConnectDot(4);
+ } else if((dot_idx == 0 && last_dot == 8) || (dot_idx == 8 && last_dot == 0) ||
+ (dot_idx == 2 && last_dot == 6) || (dot_idx == 6 && last_dot == 2)) {
+ mid = 4;
+ } else {
+ return;
}
+
+ if(!DotUsed(mid))
+ ConnectDot(mid);
}
int GUIPatternPassword::NotifyTouch(TOUCH_STATE state, int x, int y)