Opened 15 years ago

Closed 15 years ago

#3651 closed defect (fixed)

dojo.animateProperty/PropLine.getValue call to dojo.blendColors incorrect

Reported by: guest Owned by: Adam Peller
Priority: high Milestone: 0.9
Component: General Version: 0.9
Keywords: Cc:
Blocked By: Blocking:


in dojo/_base/fx.js, within dojo.animateProperty, var PropLine?, the following function exists:

this.getValue = function(n){
	var ret = {};
	for(var p in this._properties){
		var prop = this._properties[p];
		var value = null;
		if(prop.start instanceof dojo.Color){
			value = dojo.rgb2hex(dojo.blendColors(prop.end, prop.start, n));
			// value = "rbg("+dojo.blendColors(prop.end, prop.start, n).join(",")+")";
		}else if(!dojo.isArray(prop.start)){
			value = ((prop.end - prop.start) * n) + prop.start + (p != "opacity" ? prop.units||"px" : "");
		ret[p] = value;
	return ret;

The call to dojo.blendColors() at line 313 passes it n without modification as the weight parameter. The problem is that n is a percentage (from 0 to 1), while weight is from -1 to 1. Either "n" should be changed to "n*2-1" (or whatever is preferred) or the parameters dojo.blendColors() should be changed.

Change History (2)

comment:1 Changed 15 years ago by Adam Peller

Milestone: 0.9
Owner: changed from anonymous to Adam Peller

comment:2 Changed 15 years ago by Adam Peller

Resolution: fixed
Status: newclosed

(In [9588]) Fixes #3651

Note: See TracTickets for help on using tickets.