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:147


name ​

• name: string

Inherited from ​

ILeaferCanvas.name

Defined in ​

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


manager ​

• manager: ICanvasManager

Inherited from ​

ILeaferCanvas.manager

Defined in ​

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


width ​

• width: number

Inherited from ​

ILeaferCanvas.width

Defined in ​

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


height ​

• height: number

Inherited from ​

ILeaferCanvas.height

Defined in ​

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


pixelRatio ​

• pixelRatio: number

Inherited from ​

ILeaferCanvas.pixelRatio

Defined in ​

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


pixelWidth ​

• Readonly pixelWidth: number

Inherited from ​

ILeaferCanvas.pixelWidth

Defined in ​

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


pixelHeight ​

• Readonly pixelHeight: number

Inherited from ​

ILeaferCanvas.pixelHeight

Defined in ​

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


allowBackgroundColor ​

• Optional Readonly allowBackgroundColor: boolean

Inherited from ​

ILeaferCanvas.allowBackgroundColor

Defined in ​

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


backgroundColor ​

• Optional backgroundColor: string

Inherited from ​

ILeaferCanvas.backgroundColor

Defined in ​

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


hittable ​

• Optional hittable: boolean

Inherited from ​

ILeaferCanvas.hittable

Defined in ​

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


zIndex ​

• Optional zIndex: number

Inherited from ​

ILeaferCanvas.zIndex

Defined in ​

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


childIndex ​

• Optional childIndex: number

Inherited from ​

ILeaferCanvas.childIndex

Defined in ​

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


bounds ​

• bounds: IBounds

Inherited from ​

ILeaferCanvas.bounds

Defined in ​

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


clientBounds ​

• clientBounds: IBoundsData

Inherited from ​

ILeaferCanvas.clientBounds

Defined in ​

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


config ​

• config: ILeaferCanvasConfig

Inherited from ​

ILeaferCanvas.config

Defined in ​

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


autoLayout ​

• autoLayout: boolean

Inherited from ​

ILeaferCanvas.autoLayout

Defined in ​

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


view ​

• view: any

Inherited from ​

ILeaferCanvas.view

Defined in ​

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


parentView ​

• parentView: any

Inherited from ​

ILeaferCanvas.parentView

Defined in ​

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


unreal ​

• Optional unreal: boolean

Inherited from ​

ILeaferCanvas.unreal

Defined in ​

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


context ​

• context: ICanvasContext2D

Inherited from ​

ILeaferCanvas.context

Defined in ​

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


recycled ​

• Optional recycled: boolean

Inherited from ​

ILeaferCanvas.recycled

Defined in ​

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


worldTransform ​

• worldTransform: IMatrixData

Inherited from ​

ILeaferCanvas.worldTransform

Defined in ​

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


hitScale ​

• Optional hitScale: number

Defined in ​

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

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


useGrayscaleAlpha ​

▸ useGrayscaleAlpha(bounds): void

Parameters ​

NameType
boundsIBoundsData

Returns ​

void

Inherited from ​

ILeaferCanvas.useGrayscaleAlpha

Defined in ​

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


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:133


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:134


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:136


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:137


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:138


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:139


clear ​

▸ clear(): void

Returns ​

void

Inherited from ​

ILeaferCanvas.clear

Defined in ​

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


init ​

▸ init(): void

Returns ​

void

Inherited from ​

ILeaferCanvas.init

Defined in ​

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


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:186


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:187


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:188


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:189


startAutoLayout ​

▸ startAutoLayout(autoBounds, listener): void

Parameters ​

NameType
autoBoundsIAutoBounds
listenerIResizeEventListener

Returns ​

void

Inherited from ​

ILeaferCanvas.startAutoLayout

Defined in ​

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


stopAutoLayout ​

▸ stopAutoLayout(): void

Returns ​

void

Inherited from ​

ILeaferCanvas.stopAutoLayout

Defined in ​

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


resize ​

▸ resize(size, safeResize?): void

Parameters ​

NameType
sizeIScreenSizeData
safeResize?boolean

Returns ​

void

Inherited from ​

ILeaferCanvas.resize

Defined in ​

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


updateViewSize ​

▸ updateViewSize(): void

Returns ​

void

Inherited from ​

ILeaferCanvas.updateViewSize

Defined in ​

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


updateClientBounds ​

▸ updateClientBounds(): void

Returns ​

void

Inherited from ​

ILeaferCanvas.updateClientBounds

Defined in ​

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


getClientBounds ​

▸ getClientBounds(update?): IBoundsData

Parameters ​

NameType
update?boolean

Returns ​

IBoundsData

Inherited from ​

ILeaferCanvas.getClientBounds

Defined in ​

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


isSameSize ​

▸ isSameSize(options): boolean

Parameters ​

NameType
optionsILeaferCanvasConfig

Returns ​

boolean

Inherited from ​

ILeaferCanvas.isSameSize

Defined in ​

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


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:201


recycle ​

▸ recycle(clearBounds?): void

Parameters ​

NameType
clearBounds?IBoundsData

Returns ​

void

Inherited from ​

ILeaferCanvas.recycle

Defined in ​

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


updateRender ​

▸ updateRender(bounds): void

Parameters ​

NameType
boundsIBoundsData

Returns ​

void

Inherited from ​

ILeaferCanvas.updateRender

Defined in ​

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


unrealCanvas ​

▸ unrealCanvas(): void

Returns ​

void

Inherited from ​

ILeaferCanvas.unrealCanvas

Defined in ​

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


destroy ​

▸ destroy(): void

Returns ​

void

Inherited from ​

ILeaferCanvas.destroy

Defined in ​

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


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.