From 58d8fd7ccd9843a743917408bf73da69485e7f3d Mon Sep 17 00:00:00 2001 From: Jens Mönig Date: Sat, 28 Feb 2015 05:49:07 -0800 Subject: slightly optimize warped / turbo execution --- objects.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'objects.js') diff --git a/objects.js b/objects.js index 552bf8e..1fe1309 100644 --- a/objects.js +++ b/objects.js @@ -125,7 +125,7 @@ PrototypeHatBlockMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.objects = '2015-February-23'; +modules.objects = '2015-February-28'; var SpriteMorph; var StageMorph; @@ -1433,15 +1433,13 @@ SpriteMorph.prototype.setName = function (string) { SpriteMorph.prototype.drawNew = function () { var myself = this, - currentCenter = this.center(), + currentCenter, facing, // actual costume heading based on my rotation style isFlipped, - isLoadingCostume = this.costume && - typeof this.costume.loaded === 'function', + isLoadingCostume, cst, pic, // (flipped copy of) actual costume based on my rotation style - stageScale = this.parent instanceof StageMorph ? - this.parent.scale : 1, + stageScale, newX, corners = [], origin, @@ -1455,6 +1453,11 @@ SpriteMorph.prototype.drawNew = function () { this.wantsRedraw = true; return; } + currentCenter = this.center(); + isLoadingCostume = this.costume && + typeof this.costume.loaded === 'function'; + stageScale = this.parent instanceof StageMorph ? + this.parent.scale : 1; facing = this.rotationStyle ? this.heading : 90; if (this.rotationStyle === 2) { facing = 90; -- cgit v1.3.1