From 4599a71dd7a60421b3093f99f98cd215656b4d45 Mon Sep 17 00:00:00 2001 From: Paul Kaplan Date: Wed, 11 Oct 2017 16:34:50 -0400 Subject: [PATCH] Try to pin the bubbles within the left/right bounds --- src/blocks/scratch3_looks.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/blocks/scratch3_looks.js b/src/blocks/scratch3_looks.js index cb57de7e..8b9e49cc 100644 --- a/src/blocks/scratch3_looks.js +++ b/src/blocks/scratch3_looks.js @@ -125,7 +125,11 @@ class Scratch3LooksBlocks { } else { this.runtime.renderer.updateDrawableProperties(bubbleState.drawableId, { position: [ - bubbleState.onSpriteRight ? targetBounds.right : targetBounds.left - bubbleWidth, + bubbleState.onSpriteRight ? ( + Math.min(stageBounds.right - bubbleWidth, targetBounds.right) + ) : ( + Math.max(stageBounds.left, targetBounds.left - bubbleWidth) + ), Math.min(stageBounds.top, targetBounds.top + bubbleHeight) ] });