CanvasDecoration Interface
A Decoration that is drawn onto the 2d canvas on top of a ScreenViewport. CanvasDecorations may be pickable by implementing pick.
Implemented by
Methods
Name | Description | |
---|---|---|
drawDecoration(ctx: CanvasRenderingContext2D): void | Required method to draw this decoration into the supplied CanvasRenderingContext2D. | |
onMouseButton(ev: BeButtonEvent): boolean Optional | Optional method to be called whenever this decorator is picked and a mouse button is pressed or released inside this decoration. | |
onMouseEnter(ev: BeButtonEvent): void Optional | Optional method to be called whenever this decorator is picked and the mouse first enters this decoration. | |
onMouseLeave(): void Optional | Optional method to be called whenever the mouse leaves this decoration. | |
onMouseMove(ev: BeButtonEvent): void Optional | Optional method to be called whenever the mouse moves inside this decoration. | |
onWheel(ev: BeWheelEvent): boolean Optional | Optional method to be called when the mouse wheel is rolled with the pointer over this decoration. | |
pick(pt: Readonly<WritableXAndY>): boolean Optional | Optional method to provide feedback when mouse events occur on this decoration. | |
propagateMouseMove(ev: BeButtonEvent): boolean Optional | Optional method to be called whenever the mouse moves inside this decoration that determines whether the event is forwarded to the active tool. |
Properties
Name | Type | Description | |
---|---|---|---|
decorationCursor | string | undefined | Cursor to use when mouse is inside this decoration. | |
position | Readonly<WritableXAndY> | undefined | Optional view coordinates position of this overlay decoration. |
Defined in
Last Updated: 17 December, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.