#7327 closed enhancement (wontfix)
jQuery animate passes fixed firstNum, diff to easing function
Reported by: | tomalec | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | 1.7 |
Component: | effects | Version: | 1.4.3 |
Keywords: | easing, firstnum, 1.7-discuss | Cc: | |
Blocked by: | Blocking: |
Description (last modified by )
jQuery.animete uses easing function with firstNum, diff always set to 0,1:
this.pos = jQuery.easing[specialEasing || defaultEasing](this.state, n, 0, 1, this.options.duration); this.now = this.start + ((this.end - this.start) * this.pos);
So these parameters are completely useless for easing functions; for example:
swing: function( p, n, firstNum, diff ) { return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum; } }}
Could be changed to:
swing: function( p, n ) { return ((-Math.cos(p*Math.PI)/2) + 0.5); } }}
I suggest changing it to:
this.pos = jQuery.easing[specialEasing || defaultEasing](this.state, n, this.start, this.end - this.start , this.options.duration); this.now = this.pos;
Change History (13)
comment:1 Changed 12 years ago by
Component: | unfiled → effects |
---|---|
Keywords: | easing firstnum added |
Priority: | undecided → low |
Status: | new → open |
Type: | bug → enhancement |
comment:2 Changed 12 years ago by
Milestone: | → 1.next |
---|
comment:5 Changed 12 years ago by
-1, This will break plugins defining their own easing methods since it changes the scale of the arguments if I understand correctly
comment:7 follow-up: 11 Changed 12 years ago by
+0, So yeah, it's not terribly useful in its current state - but making this change will break API, which is... quite bad.
comment:8 Changed 12 years ago by
-1, this is like fixing .each(), it'd be a better API, but break all existing code
comment:10 Changed 12 years ago by
Description: | modified (diff) |
---|
-1, Seems like an unwise thing to break
comment:11 Changed 12 years ago by
Replying to john: Break API? In my opinion it will fix the API, since real first number and difference can be different that 0 and 1. But for sure it can break things that uses this variables and assumes that they are static 0, 1 (which is also quite bad)
Replying to ajpiano: So maybe make firstNum and diff represent first number and difference, not the 0, and 1?
comment:13 Changed 12 years ago by
Milestone: | 1.next → 1.7 |
---|---|
Resolution: | → wontfix |
Status: | open → closed |
Closing per 1.7 roadmap meeting resolution
Let's look at this for 1.7.