subClip property

set subClip (PRectangle? clip2)

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

Implementation

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

  var clip = this.clip;
  if (clip == null) {
    this.clip = clip2;
  } else {
    var subClip = clip.intersection(clip2);
    this.clip = subClip;
  }
}