Animatron/player — pull request #36 by shamansir (2012-08-09 22:48:03+00:00)
Title: Fix serious mistype in calculating priority + replacing removed modifiers/painters with null

Fix serious mistype in calculating priority + replacing removed modifiers/painters with `null` to make removing stable.

Full example:

var redRect = b('red-rect').rect([115, 90], [60, 60])
.fill('#f00');

var dx = redRect.modify(function(t) { this.x += 3; }).get_m_id();
var dx2 = redRect.modify(function(t) { this.x += 3; }).get_m_id();
var dy = redRect.modify(function(t) { this.y += 6; }).get_m_id();
var da = redRect.modify(function(t) { this.alpha -= 0.01; }).get_m_id();

// comment / uncomment the lines below to see the effect
//redRect.unmodify(da);
redRect.unmodify(dx);
redRect.unmodify(dx2);
redRect.unmodify(dy);

return b()
.add(
b('blue-rect').rect([140, 25], [70, 70])
.fill('#009')
.stroke('#f00', 3)
.rotate([0, 10], [0, Math.PI / 2]))
.add(redRect)
.rotate([0, 10], [0, Math.PI]);