Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion core/comments/comment_view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ export class CommentView implements IRenderedElement {
/** Whether this comment view has been disposed or not. */
private disposed = false;

/** Size of this comment when the resize drag was initiated. */
private preResizeSize?: Size;

constructor(private readonly workspace: WorkspaceSvg) {
this.svgRoot = dom.createSvgElement(Svg.G, {
'class': 'blocklyComment blocklyEditable',
Expand Down Expand Up @@ -334,8 +337,12 @@ export class CommentView implements IRenderedElement {
* elements to reflect the new size, and triggers size change listeners.
*/
setSize(size: Size) {
const oldSize = this.size;
let oldSize = this.size;
this.setSizeWithoutFiringEvents(size);
if (Size.equals(oldSize, this.size) && this.preResizeSize) {
Comment thread
gonfunko marked this conversation as resolved.
Outdated
oldSize = this.preResizeSize;
this.preResizeSize = undefined;
}
this.onSizeChange(oldSize, this.size);
}

Expand Down Expand Up @@ -519,6 +526,8 @@ export class CommentView implements IRenderedElement {
return;
}

this.preResizeSize = this.getSize();

// TODO(#7926): Move this into a utils file.
this.workspace.startDrag(
e,
Expand Down