Appearance
@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
| Name | Type |
|---|---|
imagePath | string |
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
| Name | Type |
|---|---|
src | string |
Returns
void
Methods
setTransform
setTransform(transform?): void
Parameters
| Name | Type |
|---|---|
transform? | DOMMatrix2DInit |
Returns
void
Implementation of
CanvasPattern.setTransform
toJSON
toJSON(): Object
Returns
Object
update
update(): void
Returns
void