Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/blocks/scratch3_looks.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ class Scratch3LooksBlocks {
*/
_onResetBubbles () {
for (let n = 0; n < this.runtime.targets.length; n++) {
const bubbleState = this._getBubbleState(this.runtime.targets[n]);
bubbleState.text = '';
this._onTargetWillExit(this.runtime.targets[n]);
}
clearTimeout(this._bubbleTimeout);
Expand Down Expand Up @@ -198,7 +200,13 @@ class Scratch3LooksBlocks {

// TODO is there a way to figure out before rendering whether to default left or right?
const targetBounds = target.getBounds();
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 (targetBounds.right + 170 > stageBounds.right) {
bubbleState.onSpriteRight = false;
}
Expand Down