[FEATURE] Documentation of View::required_size() should mention when it is called.
- Dominant language
- Rust
- Stars
- 4.8k
- Forks
- 270
- Avg merge
- 5d 19h
- Merged PRs (30d)
- 2
Description
**Is your feature request related to a problem? Please describe.**
Right now, the documentation of `View::required_size()` doesn't mention where in the drawing process it is called. Most views probably don't care about this as they know their size at any point in time, but for other views, there needs to be a call to `View::layout()` before the minimum size can be known. The documentation should probably mention whether the View can count on `View::layout()` having been called before the call to `View::required_size()`, or whether they need to call layout themselves.
**Describe the solution you'd like**
More detail for the documentation about `View::required_size()` to mention where in the drawing/layout process it is called. If there are no guarantees about this (which is possible, I can imagine that `View::required_size()` can be called at any point in time), maybe a little note about this could be helpful.
**Additional context**
I'm working on a Flexbox implementation for Cursive and this would be needed to know how big the cross axis is for a certain layout with a constraint for the main axis.
Contributor guide
Research direction
Locate the documentation for View::required_size() and the call sites for View::layout() in the drawing/layout process. Determine whether layout is guaranteed before required_size(), then update the method documentation to state that behavior or explicitly note the lack of a guarantee.】【。
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100