: Math.floor(this.offset(this.dur) * this.fpms) ;\r
},\r
\r
+ /*最小値に制限される\r
+ * 最小値 <= 活動持続時間 とならなければならない*/\r
+ min: "0",\r
+ \r
+ /*最大値に制限される\r
+ * 活動持続時間 <= 最大値 とならなければならない*/\r
+ max: "indefinite",\r
+ \r
/*解決した(計算する)ときの時間*/\r
resolvedTime: function() {\r
return Date.now();\r
isIndefRepeatCount = (this.repeatCount === ind),\r
isIndefRepeatDur = (this.repeatDur === ind),\r
isIndefEnd = (this.end === ind),\r
- actList = [];\r
+ actList = [],\r
+ min = Math.floor(this.offset(this.min) * this.fpms),\r
+ max = (this.max === ind) ? null : Math.floor(this.offset(this.max) * this.fpms),\r
+ s;\r
if (indef(this)) {\r
return null;\r
}\r
ind = dur = isIndefRepeatCount = isIndefRepeatDurindef = indef = void 0;\r
\r
if (actList.length === 1) {\r
- return actList[0];\r
+ s = actList[0];\r
} else if(actList.length > 1) {\r
/*属性が競合するときは、最小値をとること (SMILアニメーション 3.3.4節)*/\r
- return Math.min.apply(Math, actList);\r
+ s = Math.min.apply(Math, actList);\r
} else {\r
return null;\r
}\r
+ if ( max && (min > max) ) {\r
+ return s;\r
+ }\r
+ min && (min > s) && (s = min);\r
+ max && (max < s) && (s = max);\r
+ return s;\r
}\r
} );\r
$frame.$begin.$end.of( {\r
act.begin = 0;\r
act.repeatCount = null;\r
act.repeatDur = null;\r
- act.end = act.$begin.$end\r
+ act.end = act.$begin.$end;\r
} );\r
/*境界条件を調べておく (limit value analysis)*/\r
it("should be this for the value (limit value analysis)", function() {\r
expect(act.repeatCount).toBeNull();\r
expect(act.repeatDur).toBeNull();\r
expect(act.simpleDur()).toBeNull();\r
+ expect(act.min).toBe("0");\r
+ expect(act.max).toBe("indefinite");\r
\r
act.up("$a");\r
expect(act.$a.call()).toBeNull();\r
act.$cd.repeatDur = "12";\r
expect(act.$cd.call()).toEqual(Math.floor(12000*act.fpms));\r
\r
+ act.up("$d").mix( {\r
+ min: "2",\r
+ max: "3",\r
+ dur: "1",\r
+ simpleDur: act.simpleDur\r
+ } );\r
+ expect(act.$d.call()).toEqual(Math.floor(2000*act.fpms));\r
+ act.up("$d").mix( {\r
+ min: "1",\r
+ max: "2",\r
+ dur: "12",\r
+ simpleDur: act.simpleDur\r
+ } );\r
+ expect(act.$d.call()).toEqual(Math.floor(2000*act.fpms));\r
+ /*min > max*/\r
+ act.up("$d").mix( {\r
+ min: "3",\r
+ max: "2",\r
+ dur: "1",\r
+ simpleDur: act.simpleDur\r
+ } );\r
+ expect(act.$d.call()).toEqual(Math.floor(1000*act.fpms));\r
} );\r
/*無効同値クラスを調べておく (Equivalence partitioning, the following is the invalid partion)*/\r
it("should be this for the value (the invalid partion)", function() {\r