Skip to content

Commit

Permalink
workaround Firefox bug in fast layout functions
Browse files Browse the repository at this point in the history
  • Loading branch information
erichocean committed May 17, 2012
1 parent 4a71947 commit bfe153b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions application/layers/layout_function_fast.js
Expand Up @@ -274,10 +274,14 @@ SC.GetLayoutFunction = function(hmode, vmode, hmax, vmax, layoutMode) {

// Update the position and bounds structs with the newly-computed
// values, offset to take into account anchorX and anchorY.
src.push('position.x = x + anchorX * width;');
src.push('position.y = y + anchorY * height;');
src.push('bounds.width = width;');
src.push('bounds.height = height;');
// src.push('position.x = x + anchorX * width;');
// src.push('position.y = y + anchorY * height;');
// src.push('bounds.width = width;');
// src.push('bounds.height = height;');
src.push("Float32Array.prototype.__lookupSetter__('x').call(position, Math.floor(x + anchorX * width))");
src.push("Float32Array.prototype.__lookupSetter__('y').call(position, Math.floor(y + anchorY * height))");
src.push("Float32Array.prototype.__lookupSetter__('width').call(bounds, Math.ceil(width))");
src.push("Float32Array.prototype.__lookupSetter__('height').call(bounds, Math.ceil(height))");

if (shouldBenchmark) {
src.push('SC.Benchmark.end(benchKey);');
Expand Down

0 comments on commit bfe153b

Please sign in to comment.