BlockSuite API Documentation / @blocksuite/blocks / RoughCanvas
Class: RoughCanvas ​
Contents ​
Constructors ​
new RoughCanvas(canvas, config) ​
new RoughCanvas(
canvas
,config
?):RoughCanvas
Parameters ​
• canvas: HTMLCanvasElement
• config?: Config
Returns ​
Source ​
packages/blocks/src/surface-block/rough/canvas.ts:16
Properties ​
canvas ​
private
canvas:HTMLCanvasElement
Source ​
packages/blocks/src/surface-block/rough/canvas.ts:13
ctx ​
private
ctx:CanvasRenderingContext2D
Source ​
packages/blocks/src/surface-block/rough/canvas.ts:14
gen ​
private
gen:RoughGenerator
Source ​
packages/blocks/src/surface-block/rough/canvas.ts:12
Accessors ​
generator ​
get
generator():RoughGenerator
Returns ​
RoughGenerator
Source ​
packages/blocks/src/surface-block/rough/canvas.ts:123
Methods ​
_drawToContext() ​
private
_drawToContext(ctx
,drawing
,fixedDecimals
?,rule
?):void
Parameters ​
• ctx: CanvasRenderingContext2D
• drawing: OpSet
• fixedDecimals?: number
• rule?: CanvasFillRule
= 'nonzero'
Returns ​
void
Source ​
packages/blocks/src/surface-block/rough/canvas.ts:85
arc() ​
arc(
x
,y
,width
,height
,start
,stop
,closed
,options
?):Drawable
Parameters ​
• x: number
• y: number
• width: number
• height: number
• start: number
• stop: number
• closed: boolean
= false
• options?: Options
Returns ​
Drawable
Source ​
packages/blocks/src/surface-block/rough/canvas.ts:185
circle() ​
circle(
x
,y
,diameter
,options
?):Drawable
Parameters ​
• x: number
• y: number
• diameter: number
• options?: Options
Returns ​
Drawable
Source ​
packages/blocks/src/surface-block/rough/canvas.ts:167
curve() ​
curve(
points
,options
?):Drawable
Parameters ​
• points: Point
[]
• options?: Options
Returns ​
Drawable
Source ​
packages/blocks/src/surface-block/rough/canvas.ts:200
draw() ​
draw(
drawable
):void
Parameters ​
• drawable: Drawable
Returns ​
void
Source ​
packages/blocks/src/surface-block/rough/canvas.ts:23
ellipse() ​
ellipse(
x
,y
,width
,height
,options
?):Drawable
Parameters ​
• x: number
• y: number
• width: number
• height: number
• options?: Options
Returns ​
Drawable
Source ​
packages/blocks/src/surface-block/rough/canvas.ts:155
fillSketch() ​
private
fillSketch(ctx
,drawing
,o
):void
Parameters ​
• ctx: CanvasRenderingContext2D
• drawing: OpSet
• o: ResolvedOptions
Returns ​
void
Source ​
packages/blocks/src/surface-block/rough/canvas.ts:63
getDefaultOptions() ​
getDefaultOptions():
ResolvedOptions
Returns ​
ResolvedOptions
Source ​
packages/blocks/src/surface-block/rough/canvas.ts:127
line() ​
line(
x1
,y1
,x2
,y2
,options
?):Drawable
Parameters ​
• x1: number
• y1: number
• x2: number
• y2: number
• options?: Options
Returns ​
Drawable
Source ​
packages/blocks/src/surface-block/rough/canvas.ts:131
linearPath() ​
linearPath(
points
,options
?):Drawable
Parameters ​
• points: Point
[]
• options?: Options
Returns ​
Drawable
Source ​
packages/blocks/src/surface-block/rough/canvas.ts:173
path() ​
path(
d
,options
?):Drawable
Parameters ​
• d: string
• options?: Options
Returns ​
Drawable
Source ​
packages/blocks/src/surface-block/rough/canvas.ts:206
polygon() ​
polygon(
points
,options
?):Drawable
Parameters ​
• points: Point
[]
• options?: Options
Returns ​
Drawable
Source ​
packages/blocks/src/surface-block/rough/canvas.ts:179
rectangle() ​
rectangle(
x
,y
,width
,height
,options
?):Drawable
Parameters ​
• x: number
• y: number
• width: number
• height: number
• options?: Options
Returns ​
Drawable
Source ​
packages/blocks/src/surface-block/rough/canvas.ts:143
Generated using typedoc-plugin-markdown and TypeDoc