clip property
Returns the current drawing clip.
Implementation
@override
PRectangle? get clip => _clip;
Sets the drawing clip.
Implementation
@override
set clip(PRectangle? clip) {
if (clip == null) {
if (_clip != null) {
final widthD = canvasXD(width);
final heightD = canvasYD(height);
final rect = Rect.fromLTWH(0, 0, widthD, heightD);
_setClipGlobal(rect);
_clip = null;
}
} else {
if (_clip != clip) {
final xd = canvasXD(clip.x);
final yd = canvasYD(clip.y);
final widthD = canvasXD(clip.width);
final heightD = canvasYD(clip.height);
final rect = Rect.fromLTWH(xd, yd, widthD, heightD);
_setClipGlobal(rect);
_clip = clip;
}
}
}