Skip to content

Commit

Permalink
feat: implement IRenderedElement
Browse files Browse the repository at this point in the history
  • Loading branch information
BeksOmega committed Mar 18, 2024
1 parent 95305fc commit 75a6b98
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions core/comments/rendered_workspace_comment.ts
Expand Up @@ -7,12 +7,15 @@
import {WorkspaceComment} from './workspace_comment.js';
import {WorkspaceSvg} from '../workspace_svg.js';
import {CommentView} from './comment_view.js';
import {Coordinate, Rect, Size} from '../utils.js';
import {IBoundedElement} from '../blockly.js';
import {Coordinate} from '../utils/coordinate.js';
import {Rect} from '../utils/rect.js';
import {Size} from '../utils/size.js';
import {IBoundedElement} from '../interfaces/i_bounded_element.js';
import {IRenderedElement} from '../interfaces/i_rendered_element.js';

export class RenderedWorkspaceComment
extends WorkspaceComment
implements IBoundedElement
implements IBoundedElement, IRenderedElement
{
/** The class encompassing the svg elements making up the workspace comment. */
private view: CommentView;
Expand Down Expand Up @@ -74,6 +77,11 @@ export class RenderedWorkspaceComment
this.view.setEditable(this.isEditable());
}

/** Returns the root SVG element of this comment. */
getSvgRoot(): SVGElement {
return this.view.getSvgRoot();
}

/** Returns the bounding rectangle of this comment in workspace coordinates. */
getBoundingRectangle(): Rect {
const loc = this.getRelativeToSurfaceXY();
Expand Down

0 comments on commit 75a6b98

Please sign in to comment.