Try to pin the bubbles within the left/right bounds

This commit is contained in:
Paul Kaplan committed 2017-10-11 16:34:50 -04:00
1 parent b00a619e2d
commit 4599a71dd7
1 file changed
+5 -1
+5 -1
View File
@@ -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)
]
});