[chronojump] Fixed save curve when starts at zero and is inertial
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Fixed save curve when starts at zero and is inertial
- Date: Fri, 27 Jun 2014 21:29:56 +0000 (UTC)
commit b0330242a795ad1e9f7d1755069f199a4fc12be1
Author: Xavier de Blas <xaviblas gmail com>
Date: Fri Jun 27 23:29:29 2014 +0200
Fixed save curve when starts at zero and is inertial
src/utilEncoder.cs | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/utilEncoder.cs b/src/utilEncoder.cs
index 277daca..a42e41b 100644
--- a/src/utilEncoder.cs
+++ b/src/utilEncoder.cs
@@ -645,7 +645,7 @@ public class UtilEncoder
if(digits==start) {
startPos = i;
//but digit can be negative, check previous char if it was a '-'
- if(contents[i-1] == '-')
+ if(i>0 && contents[i-1] == '-')
startPos = i-1;
//duration == -1 means: until the end
if(duration == -1) {
@@ -661,7 +661,7 @@ public class UtilEncoder
break;
}
}
- if(startPos > 0 && digits == start + duration)
+ if(i>0 && digits == start + duration)
durationPos = i-startPos;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]