From ae3605b00c5e6c9bdca9a5af3fdbf822b23af7c5 Mon Sep 17 00:00:00 2001 From: Paul Kaplan Date: Mon, 6 Aug 2018 16:00:20 -0400 Subject: [PATCH] Remove heuristic for bubble positioning that was not accurate. "guessing" the bubble positioning before rendering is no longer needed because the positioning logic has changed, bubbles that don't fit during the positioning stage get flipped. --- src/blocks/scratch3_looks.js | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/blocks/scratch3_looks.js b/src/blocks/scratch3_looks.js index cc2f2ac4c..f95716f72 100644 --- a/src/blocks/scratch3_looks.js +++ b/src/blocks/scratch3_looks.js @@ -197,23 +197,8 @@ class Scratch3LooksBlocks { this.runtime.renderer.updateTextSkin(bubbleState.skinId, type, text, onSpriteRight, [0, 0]); } else { target.addListener(RenderedTarget.EVENT_TARGET_VISUAL_CHANGE, this._onTargetChanged); - - // TODO is there a way to figure out before rendering whether to default left or right? - const targetBounds = target.getBounds(); - const stageSize = this.runtime.renderer.getNativeSize(); - const stageBounds = { - left: -stageSize[0] / 2, - right: stageSize[0] / 2, - top: stageSize[1] / 2, - bottom: -stageSize[1] / 2 - }; - if (targetBounds.right + 170 > stageBounds.right) { - bubbleState.onSpriteRight = false; - } - bubbleState.drawableId = this.runtime.renderer.createDrawable(StageLayering.SPRITE_LAYER); bubbleState.skinId = this.runtime.renderer.createTextSkin(type, text, bubbleState.onSpriteRight, [0, 0]); - this.runtime.renderer.updateDrawableProperties(bubbleState.drawableId, { skinId: bubbleState.skinId });