jmoenig / Snap

a visual programming language inspired by Scratch

Home Page:http://snap.berkeley.edu

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reporter and Predicate Custom Blocks have no Min Width

dragazo opened this issue · comments

It looks like when rendering custom blocks, commands have a sensible minimum width, but reporters and predicates do not, which can lead to very weird-looking blocks. This is tested in the latest Snap! release (10.0.0) by creating a custom block with no text parts but a single C-ring input parameter.

Commands look ok:
untitled script pic
untitled script pic (5)

Reporters do not:
untitled script pic (1)
untitled script pic (4)

Predicates are probably the worst offender:
untitled script pic (2)
untitled script pic (3)

When text is added, the added width corrects the issue. But even without text there should probably be some minimum width that at least allows for the puzzle piece wedges of C-ring inputs to be rendered correctly.

Reporters and predicates do, in fact, have a minimum width, and it is observed when they are rendered. C-slots, however, override certain layout rules, assuming that there will also be label text. Unlabelled blocks are not a supported modality, what do you need them for, if not your own programming language?

I don't have a specific use case for these blocks, but we should still be able to render them well. Since this isn't an issue for commands blocks specifically, the code for doing this correctly must already exist somewhere and just isn't being applied to reporters/predicates.

I have no concern with the width in these pictures, but imho the height of the predicate block's C-slot is inadequate; the TURN blocks seem just to be sitting next to the predicate block, rather than attached. But I agree that this isn't a high priority.