globalPaintBounds property
Rect?
get
globalPaintBounds
Implementation
Rect? get globalPaintBounds {
final ctx = this.currentContext;
if (ctx == null) return null;
final pixelRatio = MediaQuery.of(ctx).devicePixelRatio;
final renderBox = ctx.findRenderObject() as RenderBox?;
if (renderBox == null) {
print('renderBox is null');
return Rect.zero;
}
final r = Rect.fromLTWH(
(renderBox.localToGlobal(Offset.zero).dx * pixelRatio),
(renderBox.localToGlobal(Offset.zero).dy * pixelRatio),
(renderBox.size.width * pixelRatio),
(renderBox.size.height * pixelRatio),
);
return r;
}