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

Panic due to Rect shape feathering #5664

Open
PPakalns opened this issue Jan 31, 2025 · 0 comments
Open

Panic due to Rect shape feathering #5664

PPakalns opened this issue Jan 31, 2025 · 0 comments
Labels
bug Something is broken

Comments

@PPakalns
Copy link
Contributor

PPakalns commented Jan 31, 2025

Describe the bug

When scaling UI if rendered Rect gets too small it may cause panic due to Rect being too small in some dimension and feathering was applied incorrectly (Not taking into account assert in inner function)

To Reproduce
Render small Rect under feathering threshold with texture_id set to non default value.

Expected behavior
If Rect can not be feathered, do not try to feather it.

Additional context
Egui version: 0.30

Stacktrace:

thread 'main' panicked at /home/pakalns/.cargo/git/checkouts/egui-f290029b5e1afa28/942690e/crates/epaint/src/mesh.rs:151:9:
assertion failed: self.texture_id == TextureId::default()
stack backtrace:
   0: rust_begin_unwind
             at /rustc/a730edcd67c7cb29d4458e170d4eb290387c27c3/library/std/src/panicking.rs:695:5
   1: core::panicking::panic_fmt
             at /rustc/a730edcd67c7cb29d4458e170d4eb290387c27c3/library/core/src/panicking.rs:75:14
   2: core::panicking::panic
             at /rustc/a730edcd67c7cb29d4458e170d4eb290387c27c3/library/core/src/panicking.rs:145:5
   3: colored_vertex
             at /home/pakalns/.cargo/git/checkouts/egui-f290029b5e1afa28/942690e/crates/epaint/src/mesh.rs:151:9
   4: stroke_path
   5: stroke_open
             at /home/pakalns/.cargo/git/checkouts/egui-f290029b5e1afa28/942690e/crates/epaint/src/tessellator.rs:482:9
   6: tessellate_line<epaint::stroke::Stroke>
             at /home/pakalns/.cargo/git/checkouts/egui-f290029b5e1afa28/942690e/crates/epaint/src/tessellator.rs:1587:9
   7: tessellate_rect
             at /home/pakalns/.cargo/git/checkouts/egui-f290029b5e1afa28/942690e/crates/epaint/src/tessellator.rs:1705:17
   8: tessellate_shape
             at /home/pakalns/.cargo/git/checkouts/egui-f290029b5e1afa28/942690e/crates/epaint/src/tessellator.rs:1394:17
   9: tessellate_clipped_shape
             at /home/pakalns/.cargo/git/checkouts/egui-f290029b5e1afa28/942690e/crates/epaint/src/tessellator.rs:1346:13
  10: tessellate_shapes
             at /home/pakalns/.cargo/git/checkouts/egui-f290029b5e1afa28/942690e/crates/epaint/src/tessellator.rs:2013:17
  11: {closure#0}
             at /home/pakalns/.cargo/git/checkouts/egui-f290029b5e1afa28/942690e/crates/egui/src/context.rs:2554:17
  12: write<alloc::vec::Vec<epaint::ClippedPrimitive, alloc::alloc::Global>, egui::context::{impl#18}::tessellate::{closure_env#0}>
             at /home/pakalns/.cargo/git/checkouts/egui-f290029b5e1afa28/942690e/crates/egui/src/context.rs:775:9
  13: egui::context::Context::tessellate
             at /home/pakalns/.cargo/git/checkouts/egui-f290029b5e1afa28/942690e/crates/egui/src/context.rs:2532:9
  14: process_output_system
@PPakalns PPakalns added the bug Something is broken label Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken
Projects
None yet
Development

No branches or pull requests

1 participant