Skip to content

@jtopo/core / StylePattern

Class: StylePattern

图案填充样式

js
let pattern = new StylePattern('./assets/img/pattern.jpg', 'repeat');

node.setStyles({
   fillStyle: pattern 
})

Implements

  • CanvasPattern

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new StylePattern(imagePath, repetitionStyle?)

Parameters

NameType
imagePathstring
repetitionStyle?any

Properties

className

className: string


dirty

dirty: boolean = true


repetition

repetition: string

重复: 'repeat', 'no-repeat', 'repeat-x', or 'repeat-y'

Accessors

image

get image(): string

Returns

string

set image(src): void

Parameters

NameType
srcstring

Returns

void

Methods

setTransform

setTransform(transform?): void

Parameters

NameType
transform?DOMMatrix2DInit

Returns

void

Implementation of

CanvasPattern.setTransform


toJSON

toJSON(): Object

Returns

Object


update

update(): void

Returns

void