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

[tiny-skia] Doesn't refresh and right side is cut off #2725

Open
4 tasks done
stevenxxiu opened this issue Jan 11, 2025 · 0 comments
Open
4 tasks done

[tiny-skia] Doesn't refresh and right side is cut off #2725

stevenxxiu opened this issue Jan 11, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@stevenxxiu
Copy link

stevenxxiu commented Jan 11, 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?

When running under the tiny-skia renderer, the window doesn't refresh, and the right side is cut off.

Screenshot_2025-01-11_21-09-08

A minimal reproduction:

use iced::alignment::Horizontal;
use iced::widget::{self, row, text};
use iced::{time, Element, Length, Subscription, Task};
use std::time::Duration;

struct Minimal {
  value: u32,
}

#[derive(Debug, Clone)]
pub enum Message {
  Tick,
}

impl Minimal {
  fn new() -> (Self, Task<Message>) {
    (Self { value: 0 }, widget::focus_next())
  }

  fn update(&mut self, message: Message) -> Task<Message> {
    match message {
      Message::Tick => {
        self.value += 1;
      }
    }
    Task::none()
  }

  fn subscription(&self) -> Subscription<Message> {
    time::every(Duration::from_secs(1)).map(|_instant| Message::Tick)
  }

  fn view(&self) -> Element<Message> {
    row![text("Value"), text(format!("{}%", self.value)).width(Length::Fill).align_x(Horizontal::Right)]
    .padding([0, 10])
    .into()
  }
}

pub fn main() {
  let _ = iced::application("minimal", Minimal::update, Minimal::view)
    .subscription(Minimal::subscription)
    .run_with(Minimal::new);
}

My Cargo.toml:

[package]
name = "minimal"
version = "0.2.0"
edition = "2021"

[dependencies]
iced = { version = "0.13.1", features = ["tokio"] }

[build-dependencies]
iced = "0.13.1"

[profile.release]
strip = true
lto = true
codegen-units = 1

What is the expected behavior?

Behaves the same as the wgpu renderer.

Version

crates.io release

Operating System

Arch Linux X11

Do you have any log output?

No response

@stevenxxiu stevenxxiu added the bug Something isn't working label Jan 11, 2025
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