Permalink
Browse files

Merge remote-tracking branch 'schanzer/master' into stable

Conflicts:
	js-runtime/lib/world/world.js
  • Loading branch information...
2 parents 53ae701 + 937b21a commit a36b7cb9062f2fb66d5cd0fa149e312ef7e40550 @dyoo dyoo committed Apr 2, 2013
Showing with 5 additions and 3 deletions.
  1. +5 −3 js-runtime/lib/world/world.js
@@ -348,24 +348,26 @@ if (typeof(world) === 'undefined') {
SceneImage.prototype.render = function(ctx, x, y) {
var i;
var childImage, childX, childY;
+ // create a clipping region around the boundaries of the Scene
ctx.save();
- ctx.fillStyle="white";
+ ctx.fillStyle = "rgba(0,0,0,0)";
ctx.fillRect(x, y, this.width, this.height);
ctx.restore();
ctx.save();
ctx.rect(x, y, this.width, this.height);
ctx.clip();
- // Ask every object to render itself.
+ // Ask every object to render itself inside the region
for(i = 0; i < this.children.length; i++) {
// then, render the child images
childImage = this.children[i][0];
childX = this.children[i][1];
childY = this.children[i][2];
childImage.render(ctx, childX + x, childY + y);
}
+ // unclip
ctx.restore();
- // Finally, draw the black border if withBorder is true
+
if (this.withBorder) {
ctx.strokeStyle = 'black';
ctx.strokeRect(x, y, this.width, this.height);

0 comments on commit a36b7cb

Please sign in to comment.