Skip to content

Commit

Permalink
fix: improve sizing and rendering of comments (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
gonfunko authored Oct 15, 2024
1 parent cc4d9f9 commit 1279c0a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,9 @@ const styles = `
stroke-width: 3px;
}
.blocklyCommentText::placeholder {
font-style: italic;
}
.blocklyCommentTextarea {
background-color: #fef49c;
Expand Down
4 changes: 4 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,7 @@ Blockly.ContextMenuRegistry.registry.unregister("blockDelete");
contextMenuItems.registerDeleteBlock();
Blockly.ContextMenuRegistry.registry.unregister("workspaceDelete");
contextMenuItems.registerDeleteAll();
Blockly.comments.CommentView.defaultCommentSize = new Blockly.utils.Size(
200,
200
);
1 change: 1 addition & 0 deletions src/scratch_comment_bubble.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export class ScratchCommentBubble extends Blockly.comments.CommentView {
this.sourceBlock = sourceBlock;
this.disposing = false;
this.id = Blockly.utils.idGenerator.genUid();
this.setPlaceholderText(Blockly.Msg.WORKSPACE_COMMENT_DEFAULT_TEXT);
this.getSvgRoot().setAttribute(
"style",
`--colour-commentBorder: ${sourceBlock.getColourTertiary()};`
Expand Down

0 comments on commit 1279c0a

Please # to comment.