Skip to content

Interface: ILeaferCanvas โ€‹

Hierarchy โ€‹

Implemented by โ€‹

Table of contents โ€‹

Properties โ€‹

Methods โ€‹

Properties โ€‹

strokeAlign โ€‹

โ€ข Optional strokeAlign: string

Inherited from โ€‹

ICanvasAttr.strokeAlign

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:26


strokeCap โ€‹

โ€ข Optional strokeCap: string

Inherited from โ€‹

ICanvasAttr.strokeCap

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:28


strokeJoin โ€‹

โ€ข Optional strokeJoin: string

Inherited from โ€‹

ICanvasAttr.strokeJoin

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:29


dashPattern โ€‹

โ€ข Optional dashPattern: number[]

Inherited from โ€‹

ICanvasAttr.dashPattern

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:30


dashOffset โ€‹

โ€ข Optional dashOffset: number

Inherited from โ€‹

ICanvasAttr.dashOffset

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:31


miterLimit โ€‹

โ€ข Optional miterLimit: number

Inherited from โ€‹

ICanvasAttr.miterLimit

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:32


smooth โ€‹

โ€ข smooth: boolean

Inherited from โ€‹

ICanvasAttr.smooth

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:42


smoothLevel โ€‹

โ€ข smoothLevel: string

Inherited from โ€‹

ICanvasAttr.smoothLevel

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:43


opacity โ€‹

โ€ข opacity: number

Inherited from โ€‹

ICanvasAttr.opacity

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:44


blendMode โ€‹

โ€ข blendMode: string

Inherited from โ€‹

ICanvasAttr.blendMode

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:45


fillStyle โ€‹

โ€ข fillStyle: string | object

Inherited from โ€‹

ICanvasAttr.fillStyle

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:47


strokeStyle โ€‹

โ€ข strokeStyle: string | object

Inherited from โ€‹

ICanvasAttr.strokeStyle

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:49


strokeWidth โ€‹

โ€ข strokeWidth: number

Inherited from โ€‹

ICanvasAttr.strokeWidth

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:50


shadowBlur โ€‹

โ€ข shadowBlur: number

Inherited from โ€‹

ICanvasAttr.shadowBlur

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:52


shadowColor โ€‹

โ€ข shadowColor: string

Inherited from โ€‹

ICanvasAttr.shadowColor

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:53


shadowOffsetX โ€‹

โ€ข shadowOffsetX: number

Inherited from โ€‹

ICanvasAttr.shadowOffsetX

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:54


shadowOffsetY โ€‹

โ€ข shadowOffsetY: number

Inherited from โ€‹

ICanvasAttr.shadowOffsetY

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:55


filter โ€‹

โ€ข filter: string

Inherited from โ€‹

ICanvasAttr.filter

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:57


font โ€‹

โ€ข font: string

Inherited from โ€‹

ICanvasAttr.font

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:59


fontKerning โ€‹

โ€ข fontKerning: string

Inherited from โ€‹

ICanvasAttr.fontKerning

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:60


fontStretch โ€‹

โ€ข fontStretch: string

Inherited from โ€‹

ICanvasAttr.fontStretch

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:61


fontVariantCaps โ€‹

โ€ข fontVariantCaps: string

Inherited from โ€‹

ICanvasAttr.fontVariantCaps

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:62


textAlign โ€‹

โ€ข textAlign: string

Inherited from โ€‹

ICanvasAttr.textAlign

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:64


textBaseline โ€‹

โ€ข textBaseline: string

Inherited from โ€‹

ICanvasAttr.textBaseline

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:65


textRendering โ€‹

โ€ข textRendering: string

Inherited from โ€‹

ICanvasAttr.textRendering

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:66


wordSpacing โ€‹

โ€ข wordSpacing: string

Inherited from โ€‹

ICanvasAttr.wordSpacing

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:67


letterSpacing โ€‹

โ€ข letterSpacing: string

Inherited from โ€‹

ICanvasAttr.letterSpacing

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:68


direction โ€‹

โ€ข direction: string

Inherited from โ€‹

ICanvasAttr.direction

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:70


innerId โ€‹

โ€ข Readonly innerId: number

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:146


name โ€‹

โ€ข name: string

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:147


manager โ€‹

โ€ข manager: ICanvasManager

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:149


width โ€‹

โ€ข width: number

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:151


height โ€‹

โ€ข height: number

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:152


pixelRatio โ€‹

โ€ข pixelRatio: number

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:154


pixelWidth โ€‹

โ€ข Readonly pixelWidth: number

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:155


pixelHeight โ€‹

โ€ข Readonly pixelHeight: number

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:156


allowBackgroundColor โ€‹

โ€ข Optional Readonly allowBackgroundColor: boolean

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:158


backgroundColor โ€‹

โ€ข Optional backgroundColor: string

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:159


hittable โ€‹

โ€ข Optional hittable: boolean

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:160


zIndex โ€‹

โ€ข Optional zIndex: number

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:162


childIndex โ€‹

โ€ข Optional childIndex: number

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:163


bounds โ€‹

โ€ข bounds: IBounds

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:165


clientBounds โ€‹

โ€ข clientBounds: IBoundsData

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:166


config โ€‹

โ€ข config: ILeaferCanvasConfig

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:168


autoLayout โ€‹

โ€ข autoLayout: boolean

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:170


view โ€‹

โ€ข view: any

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:172


parentView โ€‹

โ€ข parentView: any

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:173


unreal โ€‹

โ€ข Optional unreal: boolean

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:175


context โ€‹

โ€ข context: ICanvasContext2D

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:177


recycled โ€‹

โ€ข Optional recycled: boolean

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:179


worldTransform โ€‹

โ€ข worldTransform: IMatrixData

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:181

Methods โ€‹

save โ€‹

โ–ธ save(): void

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.save

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:74


restore โ€‹

โ–ธ restore(): void

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.restore

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:75


fill โ€‹

โ–ธ fill(path?, rule?): void

Parameters โ€‹

NameType
path?IWindingRule | IPath2D
rule?IWindingRule

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.fill

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:77


stroke โ€‹

โ–ธ stroke(path?): void

Parameters โ€‹

NameType
path?IPath2D

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.stroke

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:78


clip โ€‹

โ–ธ clip(path?, rule?): void

Parameters โ€‹

NameType
path?IWindingRule | IPath2D
rule?IWindingRule

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.clip

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:79


fillRect โ€‹

โ–ธ fillRect(x, y, width, height): void

Parameters โ€‹

NameType
xnumber
ynumber
widthnumber
heightnumber

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.fillRect

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:81


strokeRect โ€‹

โ–ธ strokeRect(x, y, width, height): void

Parameters โ€‹

NameType
xnumber
ynumber
widthnumber
heightnumber

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.strokeRect

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:82


clearRect โ€‹

โ–ธ clearRect(x, y, width, height): void

Parameters โ€‹

NameType
xnumber
ynumber
widthnumber
heightnumber

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.clearRect

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:83


transform โ€‹

โ–ธ transform(a, b?, c?, d?, e?, f?): void

Parameters โ€‹

NameType
anumber | IMatrixData
b?number
c?number
d?number
e?number
f?number

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.transform

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:85


translate โ€‹

โ–ธ translate(x, y): void

Parameters โ€‹

NameType
xnumber
ynumber

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.translate

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:86


scale โ€‹

โ–ธ scale(x, y): void

Parameters โ€‹

NameType
xnumber
ynumber

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.scale

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:87


rotate โ€‹

โ–ธ rotate(angle): void

Parameters โ€‹

NameType
anglenumber

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.rotate

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:88


drawImage โ€‹

โ–ธ drawImage(image, dx, dy): void

Parameters โ€‹

NameType
imageCanvasImageSource
dxnumber
dynumber

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.drawImage

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:90

โ–ธ drawImage(image, dx, dy, dw, dh): void

Parameters โ€‹

NameType
imageCanvasImageSource
dxnumber
dynumber
dwnumber
dhnumber

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.drawImage

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:91

โ–ธ drawImage(image, sx, sy, sw, sh, dx, dy, dw, dh): void

Parameters โ€‹

NameType
imageCanvasImageSource
sxnumber
synumber
swnumber
shnumber
dxnumber
dynumber
dwnumber
dhnumber

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.drawImage

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:92


setTransform โ€‹

โ–ธ setTransform(a, b?, c?, d?, e?, f?): void

Parameters โ€‹

NameType
anumber | IMatrixData
b?number
c?number
d?number
e?number
f?number

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.setTransform

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:94


getTransform โ€‹

โ–ธ getTransform(): IMatrixData

Returns โ€‹

IMatrixData

Inherited from โ€‹

ICanvasMethod.getTransform

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:95


resetTransform โ€‹

โ–ธ resetTransform(): void

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.resetTransform

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:96


createConicGradient โ€‹

โ–ธ createConicGradient(startAngle, x, y): CanvasGradient

Parameters โ€‹

NameType
startAnglenumber
xnumber
ynumber

Returns โ€‹

CanvasGradient

Inherited from โ€‹

ICanvasMethod.createConicGradient

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:98


createLinearGradient โ€‹

โ–ธ createLinearGradient(x0, y0, x1, y1): CanvasGradient

Parameters โ€‹

NameType
x0number
y0number
x1number
y1number

Returns โ€‹

CanvasGradient

Inherited from โ€‹

ICanvasMethod.createLinearGradient

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:99


createPattern โ€‹

โ–ธ createPattern(image, repetition): CanvasPattern

Parameters โ€‹

NameType
imageCanvasImageSource
repetitionstring

Returns โ€‹

CanvasPattern

Inherited from โ€‹

ICanvasMethod.createPattern

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:100


createRadialGradient โ€‹

โ–ธ createRadialGradient(x0, y0, r0, x1, y1, r1): CanvasGradient

Parameters โ€‹

NameType
x0number
y0number
r0number
x1number
y1number
r1number

Returns โ€‹

CanvasGradient

Inherited from โ€‹

ICanvasMethod.createRadialGradient

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:101


fillText โ€‹

โ–ธ fillText(text, x, y, maxWidth?): void

Parameters โ€‹

NameType
textstring
xnumber
ynumber
maxWidth?number

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.fillText

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:105


measureText โ€‹

โ–ธ measureText(text): ITextMetrics

Parameters โ€‹

NameType
textstring

Returns โ€‹

ITextMetrics

Inherited from โ€‹

ICanvasMethod.measureText

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:106


strokeText โ€‹

โ–ธ strokeText(text, x, y, maxWidth?): void

Parameters โ€‹

NameType
textstring
xnumber
ynumber
maxWidth?number

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.strokeText

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:107


saveBlendMode โ€‹

โ–ธ saveBlendMode(blendMode?): void

Parameters โ€‹

NameType
blendMode?string

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.saveBlendMode

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:111


restoreBlendMode โ€‹

โ–ธ restoreBlendMode(): void

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.restoreBlendMode

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:112


hitFill โ€‹

โ–ธ hitFill(point, fillRule?): boolean

Parameters โ€‹

NameType
pointIPointData
fillRule?string

Returns โ€‹

boolean

Inherited from โ€‹

ICanvasMethod.hitFill

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:114


hitStroke โ€‹

โ–ธ hitStroke(point, strokeWidth?): boolean

Parameters โ€‹

NameType
pointIPointData
strokeWidth?number

Returns โ€‹

boolean

Inherited from โ€‹

ICanvasMethod.hitStroke

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:115


hitPixel โ€‹

โ–ธ hitPixel(radiusPoint, offset?, scale?): boolean

Parameters โ€‹

NameType
radiusPointIRadiusPointData
offset?IPointData
scale?number

Returns โ€‹

boolean

Inherited from โ€‹

ICanvasMethod.hitPixel

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:116


setStroke โ€‹

โ–ธ setStroke(strokeStyle, strokeWidth, options?): void

Parameters โ€‹

NameType
strokeStylestring | object
strokeWidthnumber
options?ICanvasStrokeOptions

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.setStroke

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:119


setStrokeOptions โ€‹

โ–ธ setStrokeOptions(options): void

Parameters โ€‹

NameType
optionsICanvasStrokeOptions

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.setStrokeOptions

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:120


setWorld โ€‹

โ–ธ setWorld(matrix, parentMatrix?): void

Parameters โ€‹

NameType
matrixIMatrixData
parentMatrix?IMatrixData

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.setWorld

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:122


useWorldTransform โ€‹

โ–ธ useWorldTransform(worldTransform?): void

Parameters โ€‹

NameType
worldTransform?IMatrixData

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.useWorldTransform

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:123


setWorldShadow โ€‹

โ–ธ setWorldShadow(x, y, blur, color?): void

Parameters โ€‹

NameType
xnumber
ynumber
blurnumber
color?string

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.setWorldShadow

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:125


setWorldBlur โ€‹

โ–ธ setWorldBlur(blur): void

Parameters โ€‹

NameType
blurnumber

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.setWorldBlur

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:126


copyWorld โ€‹

โ–ธ copyWorld(canvas, fromBounds?, toBounds?, blendMode?): void

Parameters โ€‹

NameType
canvasILeaferCanvas
fromBounds?IBoundsData
toBounds?IBoundsData
blendMode?string

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.copyWorld

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:128


copyWorldByReset โ€‹

โ–ธ copyWorldByReset(canvas, from?, to?, blendMode?, onlyResetTransform?): void

Parameters โ€‹

NameType
canvasILeaferCanvas
from?IBoundsData
to?IBoundsData
blendMode?string
onlyResetTransform?boolean

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.copyWorldByReset

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:129


copyWorldToInner โ€‹

โ–ธ copyWorldToInner(canvas, fromWorld, toInnerBounds, blendMode?): void

Parameters โ€‹

NameType
canvasILeaferCanvas
fromWorldIMatrixWithBoundsData
toInnerBoundsIBoundsData
blendMode?string

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.copyWorldToInner

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:130


useMask โ€‹

โ–ธ useMask(maskCanvas, fromBounds?, toBounds?): void

Parameters โ€‹

NameType
maskCanvasILeaferCanvas
fromBounds?IBoundsData
toBounds?IBoundsData

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.useMask

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:132


useEraser โ€‹

โ–ธ useEraser(eraserCanvas, fromBounds?, toBounds?): void

Parameters โ€‹

NameType
eraserCanvasILeaferCanvas
fromBounds?IBoundsData
toBounds?IBoundsData

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.useEraser

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:133


fillWorld โ€‹

โ–ธ fillWorld(bounds, color, blendMode?): void

Parameters โ€‹

NameType
boundsIBoundsData
colorstring | object
blendMode?string

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.fillWorld

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:135


strokeWorld โ€‹

โ–ธ strokeWorld(bounds, color, blendMode?): void

Parameters โ€‹

NameType
boundsIBoundsData
colorstring | object
blendMode?string

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.strokeWorld

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:136


clipWorld โ€‹

โ–ธ clipWorld(bounds, ceilPixel?): void

Parameters โ€‹

NameType
boundsIBoundsData
ceilPixel?boolean

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.clipWorld

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:137


clearWorld โ€‹

โ–ธ clearWorld(bounds, ceilPixel?): void

Parameters โ€‹

NameType
boundsIBoundsData
ceilPixel?boolean

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.clearWorld

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:138


clear โ€‹

โ–ธ clear(): void

Returns โ€‹

void

Inherited from โ€‹

ICanvasMethod.clear

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:140


init โ€‹

โ–ธ init(): void

Returns โ€‹

void

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:183


export โ€‹

โ–ธ export(filename, options?): string | Promise<any>

Parameters โ€‹

NameType
filenamestring
options?number | boolean | IExportOptions

Returns โ€‹

string | Promise<any>

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:185


toBlob โ€‹

โ–ธ toBlob(type?, quality?): Promise<any>

Parameters โ€‹

NameType
type?string
quality?number

Returns โ€‹

Promise<any>

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:186


toDataURL โ€‹

โ–ธ toDataURL(type?, quality?): string | Promise<string>

Parameters โ€‹

NameType
type?string
quality?number

Returns โ€‹

string | Promise<string>

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:187


saveAs โ€‹

โ–ธ saveAs(filename, quality?): Promise<boolean>

Parameters โ€‹

NameType
filenamestring
quality?number

Returns โ€‹

Promise<boolean>

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:188


startAutoLayout โ€‹

โ–ธ startAutoLayout(autoBounds, listener): void

Parameters โ€‹

NameType
autoBoundsIAutoBounds
listenerIResizeEventListener

Returns โ€‹

void

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:190


stopAutoLayout โ€‹

โ–ธ stopAutoLayout(): void

Returns โ€‹

void

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:191


resize โ€‹

โ–ธ resize(size): void

Parameters โ€‹

NameType
sizeIScreenSizeData

Returns โ€‹

void

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:193


updateViewSize โ€‹

โ–ธ updateViewSize(): void

Returns โ€‹

void

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:194


updateClientBounds โ€‹

โ–ธ updateClientBounds(): void

Returns โ€‹

void

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:195


getClientBounds โ€‹

โ–ธ getClientBounds(update?): IBoundsData

Parameters โ€‹

NameType
update?boolean

Returns โ€‹

IBoundsData

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:196


isSameSize โ€‹

โ–ธ isSameSize(options): boolean

Parameters โ€‹

NameType
optionsILeaferCanvasConfig

Returns โ€‹

boolean

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:199


getSameCanvas โ€‹

โ–ธ getSameCanvas(useSameWorldTransform?, useSameSmooth?): ILeaferCanvas

Parameters โ€‹

NameType
useSameWorldTransform?boolean
useSameSmooth?boolean

Returns โ€‹

ILeaferCanvas

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:200


recycle โ€‹

โ–ธ recycle(clearBounds?): void

Parameters โ€‹

NameType
clearBounds?IBoundsData

Returns โ€‹

void

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:201


updateRender โ€‹

โ–ธ updateRender(bounds): void

Parameters โ€‹

NameType
boundsIBoundsData

Returns โ€‹

void

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:203


unrealCanvas โ€‹

โ–ธ unrealCanvas(): void

Returns โ€‹

void

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:204


destroy โ€‹

โ–ธ destroy(): void

Returns โ€‹

void

Defined in โ€‹

leafer/packages/interface/src/canvas/ILeaferCanvas.ts:205


beginPath โ€‹

โ–ธ beginPath(): void

Returns โ€‹

void

Inherited from โ€‹

IPathDrawer.beginPath

Defined in โ€‹

leafer/packages/interface/src/path/IPathDrawer.ts:3


moveTo โ€‹

โ–ธ moveTo(x, y): void

Parameters โ€‹

NameType
xnumber
ynumber

Returns โ€‹

void

Inherited from โ€‹

IPathDrawer.moveTo

Defined in โ€‹

leafer/packages/interface/src/path/IPathDrawer.ts:5


lineTo โ€‹

โ–ธ lineTo(x, y): void

Parameters โ€‹

NameType
xnumber
ynumber

Returns โ€‹

void

Inherited from โ€‹

IPathDrawer.lineTo

Defined in โ€‹

leafer/packages/interface/src/path/IPathDrawer.ts:6


bezierCurveTo โ€‹

โ–ธ bezierCurveTo(x1, y1, x2, y2, x, y): void

Parameters โ€‹

NameType
x1number
y1number
x2number
y2number
xnumber
ynumber

Returns โ€‹

void

Inherited from โ€‹

IPathDrawer.bezierCurveTo

Defined in โ€‹

leafer/packages/interface/src/path/IPathDrawer.ts:7


quadraticCurveTo โ€‹

โ–ธ quadraticCurveTo(x1, y1, x, y): void

Parameters โ€‹

NameType
x1number
y1number
xnumber
ynumber

Returns โ€‹

void

Inherited from โ€‹

IPathDrawer.quadraticCurveTo

Defined in โ€‹

leafer/packages/interface/src/path/IPathDrawer.ts:8


closePath โ€‹

โ–ธ closePath(): void

Returns โ€‹

void

Inherited from โ€‹

IPathDrawer.closePath

Defined in โ€‹

leafer/packages/interface/src/path/IPathDrawer.ts:9


arc โ€‹

โ–ธ arc(x, y, radius, startAngle, endAngle, anticlockwise?): void

Parameters โ€‹

NameType
xnumber
ynumber
radiusnumber
startAnglenumber
endAnglenumber
anticlockwise?boolean

Returns โ€‹

void

Inherited from โ€‹

IPathDrawer.arc

Defined in โ€‹

leafer/packages/interface/src/path/IPathDrawer.ts:11


arcTo โ€‹

โ–ธ arcTo(x1, y1, x2, y2, radius): void

Parameters โ€‹

NameType
x1number
y1number
x2number
y2number
radiusnumber

Returns โ€‹

void

Inherited from โ€‹

IPathDrawer.arcTo

Defined in โ€‹

leafer/packages/interface/src/path/IPathDrawer.ts:12


ellipse โ€‹

โ–ธ ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise?): void

Parameters โ€‹

NameType
xnumber
ynumber
radiusXnumber
radiusYnumber
rotationnumber
startAnglenumber
endAnglenumber
anticlockwise?boolean

Returns โ€‹

void

Inherited from โ€‹

IPathDrawer.ellipse

Defined in โ€‹

leafer/packages/interface/src/path/IPathDrawer.ts:13


rect โ€‹

โ–ธ rect(x, y, width, height): void

Parameters โ€‹

NameType
xnumber
ynumber
widthnumber
heightnumber

Returns โ€‹

void

Inherited from โ€‹

IPathDrawer.rect

Defined in โ€‹

leafer/packages/interface/src/path/IPathDrawer.ts:15


roundRect โ€‹

โ–ธ roundRect(x, y, width, height, radius?): void

Parameters โ€‹

NameType
xnumber
ynumber
widthnumber
heightnumber
radius?number | number[]

Returns โ€‹

void

Inherited from โ€‹

IPathDrawer.roundRect

Defined in โ€‹

leafer/packages/interface/src/path/IPathDrawer.ts:16

Released under the MIT License.