Merge pull request #268 from nathan/else-overflow

Fixed else label overflowing in some languages
This commit is contained in:
Nathan Dinsmore 2014-06-24 16:58:09 -04:00
commit 6001b87fe2

View file

@ -453,6 +453,7 @@ public class Block extends Sprite {
if ([' ', '', 'o'].indexOf(type) >= 0) x = Math.max(x, minCommandWidth); // minimum width for command blocks if ([' ', '', 'o'].indexOf(type) >= 0) x = Math.max(x, minCommandWidth); // minimum width for command blocks
if (['c', 'cf', 'e'].indexOf(type) >= 0) x = Math.max(x, minLoopWidth); // minimum width for C and E blocks if (['c', 'cf', 'e'].indexOf(type) >= 0) x = Math.max(x, minLoopWidth); // minimum width for C and E blocks
if (['h'].indexOf(type) >= 0) x = Math.max(x, minHatWidth); // minimum width for hat blocks if (['h'].indexOf(type) >= 0) x = Math.max(x, minHatWidth); // minimum width for hat blocks
if (elseLabel) x = Math.max(x, indentLeft + elseLabel.width + 2);
base.setWidthAndTopHeight(x + indentRight, indentTop + maxH + indentBottom); base.setWidthAndTopHeight(x + indentRight, indentTop + maxH + indentBottom);
if ((type == "c") || (type == "e")) fixStackLayout(); if ((type == "c") || (type == "e")) fixStackLayout();