-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve mismatch between label width and alignment #727
Conversation
This failure was due to a previous experiment with more spaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from nits, looks good to me.
masonry/src/widget/prose.rs
Outdated
@@ -11,7 +11,7 @@ use vello::peniko::BlendMode; | |||
use vello::Scene; | |||
|
|||
use crate::text::{ArcStr, TextBrush, TextWithSelection}; | |||
use crate::widget::label::LABEL_X_PADDING; | |||
use crate::widget::label::PROSE_X_PADDING; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As it's called PROSE_X_PADDING
and used here as well, maybe move it here alltogether?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lol, I didn't realise I re-used the import from both. I'll address it.
/// | ||
/// Note that setting [`alignment`](Prose::alignment) on the result | ||
/// will be meaningless. | ||
pub fn inline_prose(content: impl Into<ArcStr>) -> Prose { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe span
instead as I think it's shorter and similar to the web equivalent?
But inline_prose
on the other hand is descriptive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add a doc(alias)
for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I appreciate the improved documentation. The tests look useful. I tested the http_cats example, and it works well.
If the alignment was set previously, and the
CrossAxisAlignment
was notStart
, the width Parley believed we were in wouldn't match the width used for Masonry layout. This would lead to weird behaviour.See the diff for the test images in 0a68159 for more context