BlockSuite API Documentation / @blocksuite/blocks / RoughCanvas
Class: RoughCanvas
Constructors
new RoughCanvas()
new RoughCanvas(
canvas
,config
?):RoughCanvas
Parameters
canvas
HTMLCanvasElement
config?
Config
Returns
Defined in
packages/affine/block-surface/dist/utils/rough/canvas.d.ts:9
Accessors
generator
Get Signature
get generator():
RoughGenerator
Returns
RoughGenerator
Defined in
packages/affine/block-surface/dist/utils/rough/canvas.d.ts:8
Methods
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
options?
Returns
Drawable
Defined in
packages/affine/block-surface/dist/utils/rough/canvas.d.ts:12
circle()
circle(
x
,y
,diameter
,options
?):Drawable
Parameters
x
number
y
number
diameter
number
options?
Returns
Drawable
Defined in
packages/affine/block-surface/dist/utils/rough/canvas.d.ts:13
curve()
curve(
points
,options
?):Drawable
Parameters
points
Point
[]
options?
Returns
Drawable
Defined in
packages/affine/block-surface/dist/utils/rough/canvas.d.ts:14
draw()
draw(
drawable
):void
Parameters
drawable
Drawable
Returns
void
Defined in
packages/affine/block-surface/dist/utils/rough/canvas.d.ts:15
ellipse()
ellipse(
x
,y
,width
,height
,options
?):Drawable
Parameters
x
number
y
number
width
number
height
number
options?
Returns
Drawable
Defined in
packages/affine/block-surface/dist/utils/rough/canvas.d.ts:16
getDefaultOptions()
getDefaultOptions():
ResolvedOptions
Returns
ResolvedOptions
Defined in
packages/affine/block-surface/dist/utils/rough/canvas.d.ts:17
line()
line(
x1
,y1
,x2
,y2
,options
?):Drawable
Parameters
x1
number
y1
number
x2
number
y2
number
options?
Returns
Drawable
Defined in
packages/affine/block-surface/dist/utils/rough/canvas.d.ts:18
linearPath()
linearPath(
points
,options
?):Drawable
Parameters
points
Point
[]
options?
Returns
Drawable
Defined in
packages/affine/block-surface/dist/utils/rough/canvas.d.ts:19
path()
path(
d
,options
?):Drawable
Parameters
d
string
options?
Returns
Drawable
Defined in
packages/affine/block-surface/dist/utils/rough/canvas.d.ts:20
polygon()
polygon(
points
,options
?):Drawable
Parameters
points
Point
[]
options?
Returns
Drawable
Defined in
packages/affine/block-surface/dist/utils/rough/canvas.d.ts:21
rectangle()
rectangle(
x
,y
,width
,height
,options
?):Drawable
Parameters
x
number
y
number
width
number
height
number
options?
Returns
Drawable
Defined in
packages/affine/block-surface/dist/utils/rough/canvas.d.ts:22