Fills an area with a SVG pattern.
Implements
- I
- I
Members
Show:
Constructors
Initializes a new instance of the PatternFill class.
Initializes a new instance of the PatternFill class.
Parameters
Properties
Gets or sets the content.
Gets or sets the content.
final
Property Value
The content.
Gets or sets the origin of this pattern brush.
Gets or sets the origin of this pattern brush.
conversionfinal
Property Value
The origin of this pattern brush.
Gets or sets the size of this pattern brush.
Gets or sets the size of this pattern brush.
conversionfinal
Property Value
The size of this pattern brush.
Gets or sets the SVG view box of this pattern brush.
Gets or sets the SVG view box of this pattern brush.
conversionfinal
Property Value
The SVG view box of this pattern brush.
Methods
Callback method that checks if the specified node references the element represented by this instance.
Callback method that checks if the specified node references the element represented by this instance.
SvgDefsManager iterates elements during cleanUpDefs in the SVG DOM and calls this method to check if the element references the defs element createDefsElement created by this instance. If no element is accepted by this method, the created element will become eligible for removal from the defs section.
final
Parameters
- context: ICanvasContext
- The current canvas context.
- node: Node
- One SVG node from the SVG DOM.
- id: string
- The defs id that has been stored for this instance by the provided context.
Return Value
- boolean
trueifnodereferences the element represented by this instance.
Implements
ISvgDefsCreator.acceptAssigns the fill defined by this instance to the given SVG element.
Assigns the fill defined by this instance to the given SVG
element.If this Fill is a gradient and implements the ISvgDefsCreator interface, it will be added to the defs section of the SVG document per the context. The fill of the given element will be set to a reference to the gradient element.
This method is very similar in functionality to its static method counterpart setFill. However since this method is an instance method, it cannot be called on empty/null fills. If you are unsure whether the reference actually points to an instance, use the static helper method instead.
final
Parameters
- element: SVGElement
- The element whose fill should be set.
- context: ICanvasContext
- The context.
See Also
API
- setFill
Defined in
Fill.applyToCreates the element put into the defs section of the SVG element.
Creates the element put into the defs section of the SVG element.
Note that this method should not add an
id to the element. The caller performs this.final
Parameters
- context: ICanvasContext
- The canvas context for which this element is created..
Return Value
- SVGElement
- An SVGElement that can be put into the defs section of the SVG element. Without an
idattribute.
Implements
ISvgDefsCreator.createDefsElementFreezes and returns this instance.
Freezes and returns this instance.
Freezing an object makes it immutable, which can result in performance enhancements.
Return Value
- Fill
- This instance, made immutable.
Defined in
Fill.freezeDetermines whether this PatternFill is equal to the specified object.
Determines whether this PatternFill is equal to the specified object.
Updates the defs element with the current values, optionally.
Updates the defs element with the current values, optionally.
This method is called for each instance once per updateVisual call.
final
Parameters
- context: ICanvasContext
- The context within the elements are updated.
- oldElement: SVGElement
- The element to possibly update.