subClip property

  1. @override
set subClip (PRectangle? clip2)
override

Sets clip merging the coordinates of clip2 with the previous clip.

Implementation

@override
set subClip(PRectangle? clip2) {
  if (clip2 == null) return;

  var prevClip = clip;
  if (prevClip == null) {
    clip = clip2;
  } else {
    var subClip = prevClip.intersection(clip2);
    var clipPath = subClip.asPath2D;
    _ctx.clip(clipPath);
    _clip = subClip;
  }
}