clip property

  1. @override
PRectangle? get clip
override

Returns the current drawing clip.

Implementation

@override
PRectangle? get clip => _clip;
  1. @override
set clip (PRectangle? clip)
override

Sets the drawing clip.

  • Note that the clip won't be merged with the previouse clip (the clip coordinates are always global).
  • See subClip.

Implementation

@override
set clip(PRectangle? clip) {
  if (clip == null) {
    if (_clip != null) {
      var rect = Path2D()..rect(0, 0, width, height);
      _setClipGlobal(rect);
      _clip = null;
    }
  } else {
    if (_clip != clip) {
      var clipPath = clip.asPath2D;
      _setClipGlobal(clipPath);
      _clip = clip;
    }
  }
}