contentScreenRect property
Rect?
get
contentScreenRect
Screen rect (editor-surface coords) the visible content occupies
at the current camera fit: _cameraContentRect aspect-fit and
centered in fitRect — where the preview paints at rest. The
open / close hero morphs anchor here. Null until the source is
decoded and the fit rect measured.
Implementation
Rect? get contentScreenRect {
final rect = fitRect.value;
if (sourceSize == null || rect.isEmpty) return null;
final content = _cameraContentRect;
final scale = math.min(
rect.width / content.width,
rect.height / content.height,
);
return Rect.fromCenter(
center: rect.center,
width: content.width * scale,
height: content.height * scale,
);
}