Skip to content

Commit 1279c0a

Browse files
authored
fix: improve sizing and rendering of comments (#219)
1 parent cc4d9f9 commit 1279c0a

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

src/css.js

+3
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,9 @@ const styles = `
524524
stroke-width: 3px;
525525
}
526526
527+
.blocklyCommentText::placeholder {
528+
font-style: italic;
529+
}
527530
528531
.blocklyCommentTextarea {
529532
background-color: #fef49c;

src/index.js

+4
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,7 @@ Blockly.ContextMenuRegistry.registry.unregister("blockDelete");
129129
contextMenuItems.registerDeleteBlock();
130130
Blockly.ContextMenuRegistry.registry.unregister("workspaceDelete");
131131
contextMenuItems.registerDeleteAll();
132+
Blockly.comments.CommentView.defaultCommentSize = new Blockly.utils.Size(
133+
200,
134+
200
135+
);

src/scratch_comment_bubble.js

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export class ScratchCommentBubble extends Blockly.comments.CommentView {
1717
this.sourceBlock = sourceBlock;
1818
this.disposing = false;
1919
this.id = Blockly.utils.idGenerator.genUid();
20+
this.setPlaceholderText(Blockly.Msg.WORKSPACE_COMMENT_DEFAULT_TEXT);
2021
this.getSvgRoot().setAttribute(
2122
"style",
2223
`--colour-commentBorder: ${sourceBlock.getColourTertiary()};`

0 commit comments

Comments
 (0)