Skip to content
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

RTL Text Centering Issues #2816

Open
4 tasks done
mariinkys opened this issue Feb 25, 2025 · 1 comment
Open
4 tasks done

RTL Text Centering Issues #2816

mariinkys opened this issue Feb 25, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@mariinkys
Copy link

mariinkys commented Feb 25, 2025

Is your issue REALLY a bug?

  • My issue is indeed a bug!
  • I am not crazy! I will not fill out this form just to ask a question or request a feature. Pinky promise.

Is there an existing issue for this?

  • I have searched the existing issues.

Is this issue related to iced?

  • My hardware is compatible and my graphics drivers are up-to-date.

What happened?

Centering of RTL text not working properly inside of a button. In order to reproduce:

pub fn view(&self) -> iced::Element<'_, Message> {
        widget::Button::new(
            widget::Text::new("مرحبًا")
                .width(Length::Fill)
                .height(Length::Fill)
                .align_x(Alignment::Center)
                .align_y(Alignment::Center),
        )
        .width(Length::Fill)
        .height(Length::Fill)
        .into()
    }

Image

What is the expected behavior?

The text should be properly centered, as it happens with nor RTL text, for example:

pub fn view(&self) -> iced::Element<'_, Message> {
        widget::Button::new(
            widget::Text::new("Hello!")
                .width(Length::Fill)
                .height(Length::Fill)
                .align_x(Alignment::Center)
                .align_y(Alignment::Center),
        )
        .width(Length::Fill)
        .height(Length::Fill)
        .into()
    }

Image

Version

crates.io release

Operating System

Linux

Do you have any log output?

@mariinkys mariinkys added the bug Something isn't working label Feb 25, 2025
@mariinkys
Copy link
Author

Wanted to add that this also happens when using the git version of iced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant