-
Notifications
You must be signed in to change notification settings - Fork 600
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
Add start end end to the TextHorizontalAlignment #4550
base: master
Are you sure you want to change the base?
Conversation
RTL languages are not supported yet though, but once they will it will be usefull
The idea is that people would start now by using the right value for the enum even if it doesn't work yet. |
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 think it makes sense.
@@ -22,6 +22,12 @@ macro_rules! for_each_enums { | |||
$macro![ | |||
/// This enum describes the different types of alignment of text along the horizontal axis of a [`Text`](elements.md#text) element. | |||
enum TextHorizontalAlignment { | |||
/// The text will be aligned with the start edge of the containing box. | |||
/// This could be left or right depending on the direction of the text in the language. |
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.
/// This could be left or right depending on the direction of the text in the language. | |
/// This could be left or right depending on the direction of the text. |
/// This could be left or right depending on the direction of the text in the language. | ||
Start, | ||
/// The text will be aligned with the end edge of the containing box. | ||
/// This could be left or right depending on the direction of the text in the language. |
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.
/// This could be left or right depending on the direction of the text in the language. | |
/// This could be left or right depending on the direction of the text. |
@@ -97,9 +97,13 @@ pub fn create_layout( | |||
} | |||
|
|||
style.set_text_align(match h_align { | |||
items::TextHorizontalAlignment::Left => skia_safe::textlayout::TextAlign::Left, | |||
TextHorizontalAlignment::Start | items::TextHorizontalAlignment::Left => { |
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 think start should be mapped to skia_safe::textlayout::TextAlign::Start
; same for end.
RTL languages are not supported yet though, but once they will it will be usefull