Layer.setClip

Function/Meaning

Drawing clip rectangle settings

Type
Layerclassmethod of
Syntax
setClip(left, top, width=void, height=void)
Arguments
left

Specifies the left edge position (in image coordinates of the layer) of the drawing clip rectangle in pixels.
This value can also be obtained and set with the Layer.clipLeft property.

top

Specifies the top position of the drawing clip rectangle (in the image coordinates of the layer) in pixels.
This value can also be obtained and set with the Layer.clipTop property.

width

Specifies the width of the drawing clip rectangle in pixels.
This value can also be obtained and set with the Layer.clipWidth property.

height

Specifies the vertical width of the drawing clip rectangle in pixels.
This value can also be obtained and set with the Layer.clipHeight property.

Return value
None (void)
Explanation

Sets the drawing clip rectangle for the layer. Drawing on the layer is restricted to the inside of this drawing clip rectangle (the part outside the rectangle is not drawn).
However, some methods, such as Layer.flipLR and Layer.flipUD, are not affected by the drawing clip rectangle.
By default, the clip rectangle is set to the entire layer image area (it can be drawn on the entire layer).
The drawing clip rectangle returns to its default value when the image is loaded, the image size is changed, or the display type of the layer is changed.
You can also call this method with no arguments to restore the drawing clip rectangle to its default value.