BlockSuite API Documentation / @blocksuite/affine-block-surface / RoughCanvas
Class: RoughCanvas
Constructors
new RoughCanvas()
new RoughCanvas(
canvas
,config
?):RoughCanvas
Parameters
canvas
HTMLCanvasElement
config?
Config
Returns
Defined in
packages/affine/block-surface/src/utils/rough/canvas.ts:23
Accessors
generator
Get Signature
get generator():
RoughGenerator
Returns
RoughGenerator
Defined in
packages/affine/block-surface/src/utils/rough/canvas.ts:19
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
= false
options?
Returns
Drawable
Defined in
packages/affine/block-surface/src/utils/rough/canvas.ts:90
circle()
circle(
x
,y
,diameter
,options
?):Drawable
Parameters
x
number
y
number
diameter
number
options?
Returns
Drawable
Defined in
packages/affine/block-surface/src/utils/rough/canvas.ts:105
curve()
curve(
points
,options
?):Drawable
Parameters
points
Point
[]
options?
Returns
Drawable
Defined in
packages/affine/block-surface/src/utils/rough/canvas.ts:111
draw()
draw(
drawable
):void
Parameters
drawable
Drawable
Returns
void
Defined in
packages/affine/block-surface/src/utils/rough/canvas.ts:117
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/src/utils/rough/canvas.ts:158
getDefaultOptions()
getDefaultOptions():
ResolvedOptions
Returns
ResolvedOptions
Defined in
packages/affine/block-surface/src/utils/rough/canvas.ts:170
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/src/utils/rough/canvas.ts:174
linearPath()
linearPath(
points
,options
?):Drawable
Parameters
points
Point
[]
options?
Returns
Drawable
Defined in
packages/affine/block-surface/src/utils/rough/canvas.ts:186
path()
path(
d
,options
?):Drawable
Parameters
d
string
options?
Returns
Drawable
Defined in
packages/affine/block-surface/src/utils/rough/canvas.ts:192
polygon()
polygon(
points
,options
?):Drawable
Parameters
points
Point
[]
options?
Returns
Drawable
Defined in
packages/affine/block-surface/src/utils/rough/canvas.ts:198
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/src/utils/rough/canvas.ts:204