Skip to content

Commit d8f4724

Browse files
committed
Merge pull request scratchfoundation#165 from nathan/palette-spacing
Fixed palette spacing on More Blocks category
2 parents 84b3843 + 33add3e commit d8f4724

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/scratch/PaletteBuilder.as

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,16 @@ public class PaletteBuilder {
121121
// show creation button, hat, and call blocks
122122
var catColor:int = Specs.blockColor(Specs.procedureColor);
123123
addItem(new Button(Translator.map('Make a Block'), makeNewBlock, false, '/help/studio/tips/blocks/make-a-block/'));
124-
nextY += 5;
125-
for each (var proc:Block in app.viewedObj().procedureDefinitions()) {
126-
var b:Block = new Block(proc.spec, ' ', Specs.procedureColor, Specs.CALL, proc.defaultArgValues);
127-
addItem(b);
124+
var definitions:Array = app.viewedObj().procedureDefinitions();
125+
if (definitions.length > 0) {
126+
nextY += 5;
127+
for each (var proc:Block in definitions) {
128+
var b:Block = new Block(proc.spec, ' ', Specs.procedureColor, Specs.CALL, proc.defaultArgValues);
129+
addItem(b);
130+
}
131+
nextY += 5;
128132
}
129133

130-
nextY += 5;
131134
addItem(new Button(Translator.map('Add an Extension'), showAnExtension, false, '/help/studio/tips/blocks/add-an-extension/'));
132135
for each (var ext:* in app.extensionManager.enabledExtensions()) {
133136
addExtensionSeparator(ext);

0 commit comments

Comments
 (0)