Say window where these comments still say frame
Lengths became lengths of the window when the frame did, and `Part::From`'s own documentation still described its spans as frame lengths -- which is what the scroll above read them as.
This commit is contained in:
1 parent
e8a5792dcb
commit
a888717ee9
2 files changed
+14
-12
No files matched your search
@@ -541,7 +541,7 @@ impl PrimitiveLike for &TextureHandle {
|
|||||||
/// method's `impl` block is where a `Painter`'s own boxes are, so it takes
|
/// method's `impl` block is where a `Painter`'s own boxes are, so it takes
|
||||||
/// only what the child was asked with.
|
/// only what the child was asked with.
|
||||||
impl Painter<'_> {
|
impl Painter<'_> {
|
||||||
/// Frame ranges are already ranges on the window and combine directly.
|
/// Window ranges are already about the one unit and combine directly.
|
||||||
/// A frame pin becomes this widget's own frame wherever a length of it
|
/// A frame pin becomes this widget's own frame wherever a length of it
|
||||||
/// is what reached the child; where only pixels did, no length of this
|
/// is what reached the child; where only pixels did, no length of this
|
||||||
/// frame can change the child's and the pin stops here.
|
/// frame can change the child's and the pin stops here.
|
||||||
@@ -563,8 +563,8 @@ impl Painter<'_> {
|
|||||||
let mut result = LayoutHolds::ANY;
|
let mut result = LayoutHolds::ANY;
|
||||||
for axis in AXES {
|
for axis in AXES {
|
||||||
let n = axis as usize;
|
let n = axis as usize;
|
||||||
// Every frame range is already a range on the window: the
|
// Every read became pixels against the window, so a range on
|
||||||
// widget's own read converted through its frame exactly once.
|
// it is already in this widget's terms.
|
||||||
result.window[n] = holds.window[n];
|
result.window[n] = holds.window[n];
|
||||||
let reaches = narrow[n].is_none()
|
let reaches = narrow[n].is_none()
|
||||||
&& !matches!(place[n].part(), Part::Sized(_))
|
&& !matches!(place[n].part(), Part::Sized(_))
|
||||||
@@ -596,10 +596,10 @@ impl Painter<'_> {
|
|||||||
_ => self.extent.axis(axis).len(),
|
_ => self.extent.axis(axis).len(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// Its box is a part of this widget's frame, or a length of
|
// Its box is a length this widget decided, from its own
|
||||||
// it decided here: a length of the frame is all that reaches
|
// frame or from a sibling's answer: no length of this
|
||||||
// it, so what it holds for is a range on the frame and none
|
// widget's box reaches it, so what it holds for is a range
|
||||||
// of it on this widget's own box.
|
// on the window and none of it on that box.
|
||||||
_ => {
|
_ => {
|
||||||
result.window[n] =
|
result.window[n] =
|
||||||
result.window[n].and(holds.extent[n].through(extent.axis(axis).len()));
|
result.window[n].and(holds.extent[n].through(extent.axis(axis).len()));
|
||||||
|
|||||||
@@ -5,14 +5,16 @@ use crate::{AxisAlign, Len, PrimitiveHandle, UiRegion, UiSpan};
|
|||||||
pub enum Part {
|
pub enum Part {
|
||||||
/// The whole of it.
|
/// The whole of it.
|
||||||
All,
|
All,
|
||||||
/// Frame lengths from where the box starts, which is what a container
|
/// Window lengths from where the box starts, which is what a container
|
||||||
/// dividing room among its children speaks: a child's report is a length
|
/// dividing room among its children speaks: a child's report is a window
|
||||||
/// of the frame, so the cursor that sums those reports is one too. A
|
/// length, so the cursor that sums those reports is one too. A moved box
|
||||||
/// moved box re-places every child by re-adding its start, exactly.
|
/// re-places every child by re-adding its start, exactly. A fraction
|
||||||
|
/// here is a fraction of the window and not of the box -- the whole of a
|
||||||
|
/// box is [`Self::All`], not a `rel(1.0)` span.
|
||||||
From(UiSpan),
|
From(UiSpan),
|
||||||
/// A part of the box in its own coordinates, which is what a container
|
/// A part of the box in its own coordinates, which is what a container
|
||||||
/// that insets one speaks: taking eleven pixels off the end needs no
|
/// that insets one speaks: taking eleven pixels off the end needs no
|
||||||
/// length, where saying the same thing in frame lengths would make the
|
/// length, where saying the same thing in window lengths would make the
|
||||||
/// container read its own box -- and a box chosen from its own answer
|
/// container read its own box -- and a box chosen from its own answer
|
||||||
/// then feeds back into the answer.
|
/// then feeds back into the answer.
|
||||||
Of(UiSpan),
|
Of(UiSpan),
|
||||||
|
|||||||
Reference in new issue
Block a user