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

Text render bug using tiny-skia #2665

Open
4 tasks done
Daillusorisch opened this issue Nov 7, 2024 · 1 comment
Open
4 tasks done

Text render bug using tiny-skia #2665

Daillusorisch opened this issue Nov 7, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Daillusorisch
Copy link

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?

When two groups of text with different lengths are scrolled together, the shorter group leaves a wrong rendering after the text.
the bug 'tail'
It only happened on tiny-skia in my pc. I am on windows10, latest rustc(1.82)

Can be reproduct using this code

use iced::{
    widget::{column, container, row, scrollable, text},
    Element, Length,
};
struct A {
    text: String,
    text2: String,
}

impl Default for A {
    fn default() -> Self {
        let mut text = String::new();
        let mut text2 = String::new();
        for _ in 0..100 {
            text.push_str("J:iijji::..2131ji12j3jijiji.iji.ji.j.ij.ij.ij.i.ji.j.i\n");
            text2.push_str("J2:iijji::..2131ji12j3jijiji.iji.ji.j.ij.ij.ij.i.ji.j.i\n");
            text2.push_str("J3:iijji::..2131ji12j3jijiji.iji.ji.j.ij.ij.ij.i.ji.j.i\n");
            text2.push_str("J4:iijji::..2131ji12j3jijiji.iji.ji.j.ij.ij.ij.i.ji.j.i\n");
        }
        Self { text, text2 }
    }
}

impl A {
    fn view(&self) -> Element<()> {
        let col = container(column![text!("col {}", self.text), text!("{}", self.text)])
            .center_x(Length::Fill);

        let col1 = container(column![
            text!("col 1{}", self.text2),
            text!("{}", self.text2)
        ])
        .center_x(Length::Fill);

        container(scrollable(row![col, col1]))
            .width(iced::Length::Fill)
            .height(iced::Length::Fill)
            .into()
    }
}

fn main() {
    let _ = iced::run("test", (), A::view);
}

Cargo.toml

[package]
// your package

[dependencies]
iced = { version = "0.13", default-features=false , features = ["tiny-skia","auto-detect-theme"] }

compile, scroll and see

What is the expected behavior?

There shouldn't be any of those weird trails.

Version

crates.io release

Operating System

Windows

Do you have any log output?

No response

@Daillusorisch Daillusorisch added the bug Something isn't working label Nov 7, 2024
@Daillusorisch
Copy link
Author

Sadly, I found it happend even just scroll one column text :(

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