mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-25 07:22:33 -05:00
Merge pull request #1098 from paulkaplan/fix-say-bounds
Use renderer bounds instead of stage bounds for positioning bubbles.
This commit is contained in:
commit
8a9818d0d4
1 changed files with 7 additions and 1 deletions
|
@ -133,7 +133,13 @@ class Scratch3LooksBlocks {
|
||||||
bottom: target.y
|
bottom: target.y
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
const stageBounds = this.runtime.getTargetForStage().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 (bubbleState.onSpriteRight && bubbleWidth + targetBounds.right > stageBounds.right &&
|
if (bubbleState.onSpriteRight && bubbleWidth + targetBounds.right > stageBounds.right &&
|
||||||
(targetBounds.left - bubbleWidth > stageBounds.left)) { // Only flip if it would fit
|
(targetBounds.left - bubbleWidth > stageBounds.left)) { // Only flip if it would fit
|
||||||
bubbleState.onSpriteRight = false;
|
bubbleState.onSpriteRight = false;
|
||||||
|
|
Loading…
Reference in a new issue