OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
994 } | 994 } |
995 if (!simpleDuration) { | 995 if (!simpleDuration) { |
996 repeat = 0; | 996 repeat = 0; |
997 return 1.f; | 997 return 1.f; |
998 } | 998 } |
999 ASSERT(m_intervalBegin.isFinite()); | 999 ASSERT(m_intervalBegin.isFinite()); |
1000 ASSERT(simpleDuration.isFinite()); | 1000 ASSERT(simpleDuration.isFinite()); |
1001 SMILTime activeTime = elapsed - m_intervalBegin; | 1001 SMILTime activeTime = elapsed - m_intervalBegin; |
1002 SMILTime repeatingDuration = this->repeatingDuration(); | 1002 SMILTime repeatingDuration = this->repeatingDuration(); |
1003 if (elapsed >= m_intervalEnd || activeTime > repeatingDuration) { | 1003 if (elapsed >= m_intervalEnd || activeTime > repeatingDuration) { |
1004 repeat = static_cast<unsigned>(repeatingDuration.value() / simpleDuratio
n.value()) - 1; | 1004 repeat = static_cast<unsigned>(repeatingDuration.value() / simpleDuratio
n.value()); |
| 1005 if (!fmod(repeatingDuration.value(), simpleDuration.value())) |
| 1006 repeat--; |
1005 | 1007 |
1006 double percent = (m_intervalEnd.value() - m_intervalBegin.value()) / sim
pleDuration.value(); | 1008 double percent = (m_intervalEnd.value() - m_intervalBegin.value()) / sim
pleDuration.value(); |
1007 percent = percent - floor(percent); | 1009 percent = percent - floor(percent); |
1008 if (percent < numeric_limits<float>::epsilon() || 1 - percent < numeric_
limits<float>::epsilon()) | 1010 if (percent < numeric_limits<float>::epsilon() || 1 - percent < numeric_
limits<float>::epsilon()) |
1009 return 1.0f; | 1011 return 1.0f; |
1010 return narrowPrecisionToFloat(percent); | 1012 return narrowPrecisionToFloat(percent); |
1011 } | 1013 } |
1012 repeat = static_cast<unsigned>(activeTime.value() / simpleDuration.value()); | 1014 repeat = static_cast<unsigned>(activeTime.value() / simpleDuration.value()); |
1013 SMILTime simpleTime = fmod(activeTime.value(), simpleDuration.value()); | 1015 SMILTime simpleTime = fmod(activeTime.value(), simpleDuration.value()); |
1014 return narrowPrecisionToFloat(simpleTime.value() / simpleDuration.value()); | 1016 return narrowPrecisionToFloat(simpleTime.value() / simpleDuration.value()); |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1186 addBeginTime(elapsed, elapsed); | 1188 addBeginTime(elapsed, elapsed); |
1187 } | 1189 } |
1188 | 1190 |
1189 void SVGSMILElement::endedActiveInterval() | 1191 void SVGSMILElement::endedActiveInterval() |
1190 { | 1192 { |
1191 clearTimesWithDynamicOrigins(m_beginTimes); | 1193 clearTimesWithDynamicOrigins(m_beginTimes); |
1192 clearTimesWithDynamicOrigins(m_endTimes); | 1194 clearTimesWithDynamicOrigins(m_endTimes); |
1193 } | 1195 } |
1194 | 1196 |
1195 } | 1197 } |
OLD | NEW |