fixed block layout reach

I hope. Thanks, @brianharvey for reporting this!
pull/95/head
jmoenig 2020-06-20 12:53:36 +02:00
rodzic d39f279fa5
commit 6b8d67d3ad
2 zmienionych plików z 8 dodań i 33 usunięć

Wyświetl plik

@ -7,7 +7,7 @@
<script src="src/morphic.js?version=2020-06-13"></script> <script src="src/morphic.js?version=2020-06-13"></script>
<script src="src/symbols.js?version=2020-06-17"></script> <script src="src/symbols.js?version=2020-06-17"></script>
<script src="src/widgets.js?version=2020-05-06"></script> <script src="src/widgets.js?version=2020-05-06"></script>
<script src="src/blocks.js?version=2020-06-19"></script> <script src="src/blocks.js?version=2020-06-20"></script>
<script src="src/threads.js?version=2020-06-15"></script> <script src="src/threads.js?version=2020-06-15"></script>
<script src="src/objects.js?version=2020-06-20"></script> <script src="src/objects.js?version=2020-06-20"></script>
<script src="src/gui.js?version=2020-06-08"></script> <script src="src/gui.js?version=2020-06-08"></script>

Wyświetl plik

@ -148,7 +148,7 @@ CustomCommandBlockMorph, SymbolMorph, ToggleButtonMorph, DialMorph*/
// Global stuff //////////////////////////////////////////////////////// // Global stuff ////////////////////////////////////////////////////////
modules.blocks = '2020-June-19'; modules.blocks = '2020-June-20';
var SyntaxElementMorph; var SyntaxElementMorph;
var BlockMorph; var BlockMorph;
@ -1803,7 +1803,6 @@ SyntaxElementMorph.prototype.fixLayout = function () {
maxX = 0, maxX = 0,
blockWidth = this.minWidth, blockWidth = this.minWidth,
blockHeight, blockHeight,
affected,
l = [], l = [],
lines = [], lines = [],
space = this.isPrototype ? space = this.isPrototype ?
@ -1812,8 +1811,7 @@ SyntaxElementMorph.prototype.fixLayout = function () {
this.methodIconExtent().x + space : 0, this.methodIconExtent().x + space : 0,
bottomCorrection, bottomCorrection,
hasLoopCSlot = false, hasLoopCSlot = false,
hasLoopArrow = false, hasLoopArrow = false;
initialExtent = this.extent();
if ((this instanceof MultiArgMorph) && (this.slotSpec !== '%cs')) { if ((this instanceof MultiArgMorph) && (this.slotSpec !== '%cs')) {
blockWidth += this.arrows().width(); blockWidth += this.arrows().width();
@ -2054,35 +2052,12 @@ SyntaxElementMorph.prototype.fixLayout = function () {
} }
// find out if one of my parents needs to be fixed // find out if one of my parents needs to be fixed
if (this instanceof CommandBlockMorph) { if (this instanceof BlockMorph && this.parent && this.parent.fixLayout) {
if (this.height() !== initialExtent.y) { this.parent.fixLayout();
affected = this.parentThatIsA(CommandSlotMorph, ReporterSlotMorph); this.parent.changed();
if (affected) { return;
affected.fixLayout();
}
}
if (this.width() !== initialExtent.x) {
affected = this.parentThatIsA(
ReporterBlockMorph,
CommandSlotMorph,
RingCommandSlotMorph,
ReporterSlotMorph
);
if (affected) {
affected.fixLayout();
}
}
if (affected) {
return;
}
} else if (this instanceof ReporterBlockMorph) {
if (this.parent && this.parent.fixLayout) {
this.parent.fixLayout();
this.parent.changed();
return;
}
} }
this.fixHighlight(); this.fixHighlight();
}; };