Top
You are looking at an outdated 7.14.0 version of this document. Switch to the 8.0.1 version to see the up to date information.

class anychart.graphics.vector.Clip Improve this Doc

Class representing independent clip, that can be applied to any element.
Used to set one clip to many elements, and updates only clip.

Methods Overview

Miscellaneous
dispose()Disposes a clip. Removes it and its children from defs, clears the clip for managed elements.
shape()Shape settings for the clip.

Methods Description

dispose

Disposes a clip. Removes it and its children from defs, clears the clip for managed elements.

Try it:

shape

Getter for the current shape of the clip.

Returns:

anychart.graphics.vector.Shape - The current shape.
See listing
var rectangle = stage.rect(20, 20, 100, 100);
rectangle.clip(stage.createClip());
var clipArea = rectangle.clip();
clipArea.shape();
Setter for the shape of the clip.

Params:

Name Type Description
shape Array.<number> | anychart.graphics.vector.Shape | anychart.graphics.math.Rect | Object | null Rect or vector shape or array or object representing bounds.

Returns:

anychart.graphics.vector.Clip - Self instance for method chaining.

Try it:

Setter for the shape of the clip with coordinates.

Params:

Name Type Description
left number Left coordinate.
top number Top coordinate.
width number Width of the rect.
height number Height of the rect.

Returns:

anychart.graphics.vector.Clip - Self instance for method chaining.

Try it: