File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1792,6 +1792,20 @@ class Path extends NativeFieldWrapperClass2 {
17921792 Path _transform (Float64List matrix4) native 'Path_transform' ;
17931793
17941794 /// Computes the bounding rectangle for this path.
1795+ ///
1796+ /// A path containing only axis-aligned points on the same straight line will
1797+ /// have no area, and therefore `Rect.isEmpty` will return true for such a
1798+ /// path. Consider checking `rect.width + rect.height > 0.0` instead, or
1799+ /// using the [computeMetrics] API to check the path length.
1800+ ///
1801+ /// For many more elaborate paths, the bounds may be inaccurate. For example,
1802+ /// when a path contains a circle, the points used to compute the bounds are
1803+ /// the circle's implied control points, which form a square around the circle;
1804+ /// if the circle has a transformation applied using [transform] then that
1805+ /// square is rotated, and the (axis-aligned, non-rotated) bounding box
1806+ /// therefore ends up grossly overestimating the actual area covered by the
1807+ /// circle.
1808+ // see https://skia.org/user/api/SkPath_Reference#SkPath_getBounds
17951809 Rect getBounds () {
17961810 final Float32List rect = _getBounds ();
17971811 return new Rect .fromLTRB (rect[0 ], rect[1 ], rect[2 ], rect[3 ]);
You can’t perform that action at this time.
0 commit comments