* A size that can be used as a hint by layout functions. * * Implementations should typically return the intrinsic content size or a * size that fits all the view's content. * * The default implementation returns a size that fits all the view's * subviews. * * Can be overridd
()
| 145 | * Can be overridden by subclasses. |
| 146 | */ |
| 147 | desiredSize(): Size | IntrinsicSize { |
| 148 | if (this._needsDisplay) { |
| 149 | this.layoutSubviews(); |
| 150 | } |
| 151 | const frames = this.subviews.map(subview => subview.frame); |
| 152 | return unionOfRects(...frames).size; |
| 153 | } |
| 154 | |
| 155 | /** |
| 156 | * Appends `view` to the list of this view's `subviews`. |
no test coverage detected