Skip to content

Interface: IHitCanvas โ€‹

Hierarchy โ€‹

Table of contents โ€‹

Properties โ€‹

Methods โ€‹

Properties โ€‹

strokeAlign โ€‹

โ€ข Optional strokeAlign: string

Inherited from โ€‹

ILeaferCanvas.strokeAlign

Defined in โ€‹

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


strokeCap โ€‹

โ€ข Optional strokeCap: string

Inherited from โ€‹

ILeaferCanvas.strokeCap

Defined in โ€‹

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


strokeJoin โ€‹

โ€ข Optional strokeJoin: string

Inherited from โ€‹

ILeaferCanvas.strokeJoin

Defined in โ€‹

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


dashPattern โ€‹

โ€ข Optional dashPattern: number[]

Inherited from โ€‹

ILeaferCanvas.dashPattern

Defined in โ€‹

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


dashOffset โ€‹

โ€ข Optional dashOffset: number

Inherited from โ€‹

ILeaferCanvas.dashOffset

Defined in โ€‹

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


miterLimit โ€‹

โ€ข Optional miterLimit: number

Inherited from โ€‹

ILeaferCanvas.miterLimit

Defined in โ€‹

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


smooth โ€‹

โ€ข smooth: boolean

Inherited from โ€‹

ILeaferCanvas.smooth

Defined in โ€‹

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


smoothLevel โ€‹

โ€ข smoothLevel: string

Inherited from โ€‹

ILeaferCanvas.smoothLevel

Defined in โ€‹

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


opacity โ€‹

โ€ข opacity: number

Inherited from โ€‹

ILeaferCanvas.opacity

Defined in โ€‹

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


blendMode โ€‹

โ€ข blendMode: string

Inherited from โ€‹

ILeaferCanvas.blendMode

Defined in โ€‹

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


fillStyle โ€‹

โ€ข fillStyle: string | object

Inherited from โ€‹

ILeaferCanvas.fillStyle

Defined in โ€‹

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


strokeStyle โ€‹

โ€ข strokeStyle: string | object

Inherited from โ€‹

ILeaferCanvas.strokeStyle

Defined in โ€‹

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


strokeWidth โ€‹

โ€ข strokeWidth: number

Inherited from โ€‹

ILeaferCanvas.strokeWidth

Defined in โ€‹

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


shadowBlur โ€‹

โ€ข shadowBlur: number

Inherited from โ€‹

ILeaferCanvas.shadowBlur

Defined in โ€‹

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


shadowColor โ€‹

โ€ข shadowColor: string

Inherited from โ€‹

ILeaferCanvas.shadowColor

Defined in โ€‹

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


shadowOffsetX โ€‹

โ€ข shadowOffsetX: number

Inherited from โ€‹

ILeaferCanvas.shadowOffsetX

Defined in โ€‹

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


shadowOffsetY โ€‹

โ€ข shadowOffsetY: number

Inherited from โ€‹

ILeaferCanvas.shadowOffsetY

Defined in โ€‹

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


filter โ€‹

โ€ข filter: string

Inherited from โ€‹

ILeaferCanvas.filter

Defined in โ€‹

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


font โ€‹

โ€ข font: string

Inherited from โ€‹

ILeaferCanvas.font

Defined in โ€‹

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


fontKerning โ€‹

โ€ข fontKerning: string

Inherited from โ€‹

ILeaferCanvas.fontKerning

Defined in โ€‹

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


fontStretch โ€‹

โ€ข fontStretch: string

Inherited from โ€‹

ILeaferCanvas.fontStretch

Defined in โ€‹

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


fontVariantCaps โ€‹

โ€ข fontVariantCaps: string

Inherited from โ€‹

ILeaferCanvas.fontVariantCaps

Defined in โ€‹

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


textAlign โ€‹

โ€ข textAlign: string

Inherited from โ€‹

ILeaferCanvas.textAlign

Defined in โ€‹

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


textBaseline โ€‹

โ€ข textBaseline: string

Inherited from โ€‹

ILeaferCanvas.textBaseline

Defined in โ€‹

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


textRendering โ€‹

โ€ข textRendering: string

Inherited from โ€‹

ILeaferCanvas.textRendering

Defined in โ€‹

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


wordSpacing โ€‹

โ€ข wordSpacing: string

Inherited from โ€‹

ILeaferCanvas.wordSpacing

Defined in โ€‹

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


letterSpacing โ€‹

โ€ข letterSpacing: string

Inherited from โ€‹

ILeaferCanvas.letterSpacing

Defined in โ€‹

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


direction โ€‹

โ€ข direction: string

Inherited from โ€‹

ILeaferCanvas.direction

Defined in โ€‹

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


innerId โ€‹

โ€ข Readonly innerId: number

Inherited from โ€‹

ILeaferCanvas.innerId

Defined in โ€‹

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


name โ€‹

โ€ข name: string

Inherited from โ€‹

ILeaferCanvas.name

Defined in โ€‹

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


manager โ€‹

โ€ข manager: ICanvasManager

Inherited from โ€‹

ILeaferCanvas.manager

Defined in โ€‹

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


width โ€‹

โ€ข width: number

Inherited from โ€‹

ILeaferCanvas.width

Defined in โ€‹

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


height โ€‹

โ€ข height: number

Inherited from โ€‹

ILeaferCanvas.height

Defined in โ€‹

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


pixelRatio โ€‹

โ€ข pixelRatio: number

Inherited from โ€‹

ILeaferCanvas.pixelRatio

Defined in โ€‹

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


pixelWidth โ€‹

โ€ข Readonly pixelWidth: number

Inherited from โ€‹

ILeaferCanvas.pixelWidth

Defined in โ€‹

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


pixelHeight โ€‹

โ€ข Readonly pixelHeight: number

Inherited from โ€‹

ILeaferCanvas.pixelHeight

Defined in โ€‹

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


allowBackgroundColor โ€‹

โ€ข Optional Readonly allowBackgroundColor: boolean

Inherited from โ€‹

ILeaferCanvas.allowBackgroundColor

Defined in โ€‹

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


backgroundColor โ€‹

โ€ข Optional backgroundColor: string

Inherited from โ€‹

ILeaferCanvas.backgroundColor

Defined in โ€‹

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


hittable โ€‹

โ€ข Optional hittable: boolean

Inherited from โ€‹

ILeaferCanvas.hittable

Defined in โ€‹

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


zIndex โ€‹

โ€ข Optional zIndex: number

Inherited from โ€‹

ILeaferCanvas.zIndex

Defined in โ€‹

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


childIndex โ€‹

โ€ข Optional childIndex: number

Inherited from โ€‹

ILeaferCanvas.childIndex

Defined in โ€‹

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


bounds โ€‹

โ€ข bounds: IBounds

Inherited from โ€‹

ILeaferCanvas.bounds

Defined in โ€‹

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


clientBounds โ€‹

โ€ข clientBounds: IBoundsData

Inherited from โ€‹

ILeaferCanvas.clientBounds

Defined in โ€‹

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


config โ€‹

โ€ข config: ILeaferCanvasConfig

Inherited from โ€‹

ILeaferCanvas.config

Defined in โ€‹

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


autoLayout โ€‹

โ€ข autoLayout: boolean

Inherited from โ€‹

ILeaferCanvas.autoLayout

Defined in โ€‹

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


view โ€‹

โ€ข view: any

Inherited from โ€‹

ILeaferCanvas.view

Defined in โ€‹

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


parentView โ€‹

โ€ข parentView: any

Inherited from โ€‹

ILeaferCanvas.parentView

Defined in โ€‹

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


unreal โ€‹

โ€ข Optional unreal: boolean

Inherited from โ€‹

ILeaferCanvas.unreal

Defined in โ€‹

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


context โ€‹

โ€ข context: ICanvasContext2D

Inherited from โ€‹

ILeaferCanvas.context

Defined in โ€‹

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


recycled โ€‹

โ€ข Optional recycled: boolean

Inherited from โ€‹

ILeaferCanvas.recycled

Defined in โ€‹

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


worldTransform โ€‹

โ€ข worldTransform: IMatrixData

Inherited from โ€‹

ILeaferCanvas.worldTransform

Defined in โ€‹

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


hitScale โ€‹

โ€ข Optional hitScale: number

Defined in โ€‹

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

Methods โ€‹

save โ€‹

โ–ธ save(): void

Returns โ€‹

void

Inherited from โ€‹

ILeaferCanvas.save

Defined in โ€‹

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


restore โ€‹

โ–ธ restore(): void

Returns โ€‹

void

Inherited from โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.fill

Defined in โ€‹

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


stroke โ€‹

โ–ธ stroke(path?): void

Parameters โ€‹

NameType
path?IPath2D

Returns โ€‹

void

Inherited from โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.transform

Defined in โ€‹

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


translate โ€‹

โ–ธ translate(x, y): void

Parameters โ€‹

NameType
xnumber
ynumber

Returns โ€‹

void

Inherited from โ€‹

ILeaferCanvas.translate

Defined in โ€‹

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


scale โ€‹

โ–ธ scale(x, y): void

Parameters โ€‹

NameType
xnumber
ynumber

Returns โ€‹

void

Inherited from โ€‹

ILeaferCanvas.scale

Defined in โ€‹

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


rotate โ€‹

โ–ธ rotate(angle): void

Parameters โ€‹

NameType
anglenumber

Returns โ€‹

void

Inherited from โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.setTransform

Defined in โ€‹

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


getTransform โ€‹

โ–ธ getTransform(): IMatrixData

Returns โ€‹

IMatrixData

Inherited from โ€‹

ILeaferCanvas.getTransform

Defined in โ€‹

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


resetTransform โ€‹

โ–ธ resetTransform(): void

Returns โ€‹

void

Inherited from โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.createLinearGradient

Defined in โ€‹

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


createPattern โ€‹

โ–ธ createPattern(image, repetition): CanvasPattern

Parameters โ€‹

NameType
imageCanvasImageSource
repetitionstring

Returns โ€‹

CanvasPattern

Inherited from โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.fillText

Defined in โ€‹

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


measureText โ€‹

โ–ธ measureText(text): ITextMetrics

Parameters โ€‹

NameType
textstring

Returns โ€‹

ITextMetrics

Inherited from โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.strokeText

Defined in โ€‹

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


saveBlendMode โ€‹

โ–ธ saveBlendMode(blendMode?): void

Parameters โ€‹

NameType
blendMode?string

Returns โ€‹

void

Inherited from โ€‹

ILeaferCanvas.saveBlendMode

Defined in โ€‹

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


restoreBlendMode โ€‹

โ–ธ restoreBlendMode(): void

Returns โ€‹

void

Inherited from โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.setStroke

Defined in โ€‹

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


setStrokeOptions โ€‹

โ–ธ setStrokeOptions(options): void

Parameters โ€‹

NameType
optionsICanvasStrokeOptions

Returns โ€‹

void

Inherited from โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.setWorld

Defined in โ€‹

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


useWorldTransform โ€‹

โ–ธ useWorldTransform(worldTransform?): void

Parameters โ€‹

NameType
worldTransform?IMatrixData

Returns โ€‹

void

Inherited from โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.setWorldShadow

Defined in โ€‹

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


setWorldBlur โ€‹

โ–ธ setWorldBlur(blur): void

Parameters โ€‹

NameType
blurnumber

Returns โ€‹

void

Inherited from โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.clearWorld

Defined in โ€‹

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


clear โ€‹

โ–ธ clear(): void

Returns โ€‹

void

Inherited from โ€‹

ILeaferCanvas.clear

Defined in โ€‹

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


init โ€‹

โ–ธ init(): void

Returns โ€‹

void

Inherited from โ€‹

ILeaferCanvas.init

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>

Inherited from โ€‹

ILeaferCanvas.export

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>

Inherited from โ€‹

ILeaferCanvas.toBlob

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>

Inherited from โ€‹

ILeaferCanvas.toDataURL

Defined in โ€‹

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


saveAs โ€‹

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

Parameters โ€‹

NameType
filenamestring
quality?number

Returns โ€‹

Promise<boolean>

Inherited from โ€‹

ILeaferCanvas.saveAs

Defined in โ€‹

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


startAutoLayout โ€‹

โ–ธ startAutoLayout(autoBounds, listener): void

Parameters โ€‹

NameType
autoBoundsIAutoBounds
listenerIResizeEventListener

Returns โ€‹

void

Inherited from โ€‹

ILeaferCanvas.startAutoLayout

Defined in โ€‹

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


stopAutoLayout โ€‹

โ–ธ stopAutoLayout(): void

Returns โ€‹

void

Inherited from โ€‹

ILeaferCanvas.stopAutoLayout

Defined in โ€‹

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


resize โ€‹

โ–ธ resize(size): void

Parameters โ€‹

NameType
sizeIScreenSizeData

Returns โ€‹

void

Inherited from โ€‹

ILeaferCanvas.resize

Defined in โ€‹

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


updateViewSize โ€‹

โ–ธ updateViewSize(): void

Returns โ€‹

void

Inherited from โ€‹

ILeaferCanvas.updateViewSize

Defined in โ€‹

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


updateClientBounds โ€‹

โ–ธ updateClientBounds(): void

Returns โ€‹

void

Inherited from โ€‹

ILeaferCanvas.updateClientBounds

Defined in โ€‹

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


getClientBounds โ€‹

โ–ธ getClientBounds(update?): IBoundsData

Parameters โ€‹

NameType
update?boolean

Returns โ€‹

IBoundsData

Inherited from โ€‹

ILeaferCanvas.getClientBounds

Defined in โ€‹

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


isSameSize โ€‹

โ–ธ isSameSize(options): boolean

Parameters โ€‹

NameType
optionsILeaferCanvasConfig

Returns โ€‹

boolean

Inherited from โ€‹

ILeaferCanvas.isSameSize

Defined in โ€‹

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


getSameCanvas โ€‹

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

Parameters โ€‹

NameType
useSameWorldTransform?boolean
useSameSmooth?boolean

Returns โ€‹

ILeaferCanvas

Inherited from โ€‹

ILeaferCanvas.getSameCanvas

Defined in โ€‹

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


recycle โ€‹

โ–ธ recycle(clearBounds?): void

Parameters โ€‹

NameType
clearBounds?IBoundsData

Returns โ€‹

void

Inherited from โ€‹

ILeaferCanvas.recycle

Defined in โ€‹

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


updateRender โ€‹

โ–ธ updateRender(bounds): void

Parameters โ€‹

NameType
boundsIBoundsData

Returns โ€‹

void

Inherited from โ€‹

ILeaferCanvas.updateRender

Defined in โ€‹

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


unrealCanvas โ€‹

โ–ธ unrealCanvas(): void

Returns โ€‹

void

Inherited from โ€‹

ILeaferCanvas.unrealCanvas

Defined in โ€‹

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


destroy โ€‹

โ–ธ destroy(): void

Returns โ€‹

void

Inherited from โ€‹

ILeaferCanvas.destroy

Defined in โ€‹

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


beginPath โ€‹

โ–ธ beginPath(): void

Returns โ€‹

void

Inherited from โ€‹

ILeaferCanvas.beginPath

Defined in โ€‹

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


moveTo โ€‹

โ–ธ moveTo(x, y): void

Parameters โ€‹

NameType
xnumber
ynumber

Returns โ€‹

void

Inherited from โ€‹

ILeaferCanvas.moveTo

Defined in โ€‹

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


lineTo โ€‹

โ–ธ lineTo(x, y): void

Parameters โ€‹

NameType
xnumber
ynumber

Returns โ€‹

void

Inherited from โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.quadraticCurveTo

Defined in โ€‹

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


closePath โ€‹

โ–ธ closePath(): void

Returns โ€‹

void

Inherited from โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.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 โ€‹

ILeaferCanvas.roundRect

Defined in โ€‹

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

Released under the MIT License.