Skip to content

Fix Layout::resolve panicking under some circumstances#1637

Merged
hecrj merged 1 commit intomasterfrom
fix/layout-resolve-panic
Jan 5, 2023
Merged

Fix Layout::resolve panicking under some circumstances#1637
hecrj merged 1 commit intomasterfrom
fix/layout-resolve-panic

Conversation

@hecrj
Copy link
Member

@hecrj hecrj commented Jan 5, 2023

When fill has a bigger Size than max.

Fixes #1619.

When `fill` has a bigger `Size` than `max`.
@hecrj hecrj added bug Something isn't working layout labels Jan 5, 2023
@hecrj hecrj added this to the 0.7.0 milestone Jan 5, 2023
@hecrj hecrj merged commit 43374f1 into master Jan 5, 2023
@hecrj hecrj deleted the fix/layout-resolve-panic branch January 5, 2023 16:19
@udoprog
Copy link

udoprog commented Jan 5, 2023

I'm hitting this one as well (related to #1619): https://github.com/iced-rs/iced/blob/master/native/src/layout/limits.rs#L53

I suspect most of the ones introduced in #1611 should be reverted?

thread 'main' panicked at 'assertion failed: min <= max', /rustc/77429957a0e9c90a26c89def061ffdd4bae5ccb9\library\core\src\num\f32.rs:1394:9
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/77429957a0e9c90a26c89def061ffdd4bae5ccb9/library\std\src\panicking.rs:575
   1: core::panicking::panic_fmt
             at /rustc/77429957a0e9c90a26c89def061ffdd4bae5ccb9/library\core\src\panicking.rs:64
   2: core::panicking::panic
             at /rustc/77429957a0e9c90a26c89def061ffdd4bae5ccb9/library\core\src\panicking.rs:112
   3: core::f32::impl$0::clamp
             at /rustc/77429957a0e9c90a26c89def061ffdd4bae5ccb9\library\core\src\num\f32.rs:1394
   4: iced_native::layout::limits::Limits::height
             at C:\Users\udoprog\.cargo\git\checkouts\iced-ea969e5e59b83896\6212f10\native\src\layout\limits.rs:76

@hecrj
Copy link
Member Author

hecrj commented Jan 5, 2023

@udoprog Sigh... This clippy lint isn't great. Hopefully #1639 fixes everything.

@udoprog
Copy link

udoprog commented Jan 5, 2023

Yeah. At least it seems like it'll be disabled by default in 1.67 now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working layout

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flex layout panics when forced to too small place

2 participants