Author: toshok
Date: 2007-11-07 17:16:17 -0500 (Wed, 07 Nov 2007)
New Revision: 89171
Modified:
trunk/moon/src/ChangeLog
trunk/moon/src/clock.cpp
Log:
2007-11-07 Chris Toshok <[EMAIL PROTECTED]>
* clock.cpp (Clock::Begin): guard against division by zero.
Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog 2007-11-07 22:12:08 UTC (rev 89170)
+++ trunk/moon/src/ChangeLog 2007-11-07 22:16:17 UTC (rev 89171)
@@ -1,5 +1,9 @@
2007-11-07 Chris Toshok <[EMAIL PROTECTED]>
+ * clock.cpp (Clock::Begin): guard against division by zero.
+
+2007-11-07 Chris Toshok <[EMAIL PROTECTED]>
+
* runtime.cpp, runtime.h: make GetWidth()/GetHeight() return the
width the canvas tells the surface to be (if it does). this fixes
issues uncovered by larry's improved bounds checking code. Also,
Modified: trunk/moon/src/clock.cpp
===================================================================
--- trunk/moon/src/clock.cpp 2007-11-07 22:12:08 UTC (rev 89170)
+++ trunk/moon/src/clock.cpp 2007-11-07 22:16:17 UTC (rev 89171)
@@ -776,10 +776,15 @@
}
if (natural_duration.HasTimeSpan ()) {
- current_progress = new_progress = (double)current_time /
natural_duration.GetTimeSpan();
- if (current_progress > 1.0) {
+ if (natural_duration.GetTimeSpan() == 0) {
current_progress = new_progress = 1.0;
}
+ else {
+ current_progress = new_progress = (double)current_time
/ natural_duration.GetTimeSpan();
+ if (current_progress > 1.0) {
+ current_progress = new_progress = 1.0;
+ }
+ }
}
else
current_progress = new_progress = 0.0;
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches