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

[Bug]: table::fit not work #975

Closed
bigfoodK opened this issue Oct 16, 2024 · 0 comments · Fixed by #978
Closed

[Bug]: table::fit not work #975

bigfoodK opened this issue Oct 16, 2024 · 0 comments · Fixed by #978
Assignees
Labels
bug Something isn't working namui-prebuilt

Comments

@bigfoodK
Copy link
Contributor

Expected Behavior

work

Actual Behavior

Unwrap error occurs

namui-runtime-wasm.wasm:0x9110ea Uncaught (in promise) RuntimeError: unreachable
    at namui_runtime_wasm-d79e21e4960cd98b.wasm.__rust_start_panic (namui-runtime-wasm.wasm:0x9110ea)
    at namui_runtime_wasm-d79e21e4960cd98b.wasm.rust_panic (namui-runtime-wasm.wasm:0x9108d1)
    at namui_runtime_wasm-d79e21e4960cd98b.wasm._ZN3std9panicking20rust_panic_with_hook17h6bc6254a9f207566E (namui-runtime-wasm.wasm:0x910729)
    at namui_runtime_wasm-d79e21e4960cd98b.wasm._ZN3std9panicking19begin_panic_handler28_$u7b$$u7b$closure$u7d$$u7d$17hed5e78101063bd4fE (namui-runtime-wasm.wasm:0x90faaa)
    at namui_runtime_wasm-d79e21e4960cd98b.wasm._ZN3std10sys_common9backtrace26__rust_end_short_backtrace17h08e3b71812f4bd9eE (namui-runtime-wasm.wasm:0x90f9da)
    at namui_runtime_wasm-d79e21e4960cd98b.wasm.rust_begin_unwind (namui-runtime-wasm.wasm:0x91021f)
    at namui_runtime_wasm-d79e21e4960cd98b.wasm._ZN4core9panicking9panic_fmt17hc41f2845b2c81a3eE (namui-runtime-wasm.wasm:0x91a426)
    at namui_runtime_wasm-d79e21e4960cd98b.wasm._ZN4core9panicking5panic17ha9b831c8f33e0a3bE (namui-runtime-wasm.wasm:0x91a97b)
    at namui_runtime_wasm-d79e21e4960cd98b.wasm._ZN4core6option13unwrap_failed17h930263b63567231fE (namui-runtime-wasm.wasm:0x9206d7)
    at namui_runtime_wasm-d79e21e4960cd98b.wasm._ZN107_$LT$namui_prebuilt..table..InternalSlice$u20$as$u20$namui_hooks..component..component_trait..Component$GT$6render17hb1222cbb852f9dd4E (namui-runtime-wasm.wasm:0x230ca2)
$__rust_start_panic	@	namui-runtime-wasm.wasm:0x9110ea
$rust_panic	@	namui-runtime-wasm.wasm:0x9108d1
$_ZN3std9panicking20rust_panic_with_hook17h6bc6254a9f207566E	@	namui-runtime-wasm.wasm:0x910729
$_ZN3std9panicking19begin_panic_handler28_$u7b$$u7b$closure$u7d$$u7d$17hed5e78101063bd4fE	@	namui-runtime-wasm.wasm:0x90faaa
$_ZN3std10sys_common9backtrace26__rust_end_short_backtrace17h08e3b71812f4bd9eE	@	namui-runtime-wasm.wasm:0x90f9da
$rust_begin_unwind	@	namui-runtime-wasm.wasm:0x91021f
$_ZN4core9panicking9panic_fmt17hc41f2845b2c81a3eE	@	namui-runtime-wasm.wasm:0x91a426
$_ZN4core9panicking5panic17ha9b831c8f33e0a3bE	@	namui-runtime-wasm.wasm:0x91a97b
$_ZN4core6option13unwrap_failed17h930263b63567231fE	@	namui-runtime-wasm.wasm:0x9206d7
$_ZN107_$LT$namui_prebuilt..table..InternalSlice$u20$as$u20$namui_hooks..component..component_trait..Component$GT$6render17hb1222cbb852f9dd4E	@	namui-runtime-wasm.wasm:0x230ca2
$_ZN11namui_hooks7compose3ctx6public55_$LT$impl$u20$namui_hooks..compose..ctx..ComposeCtx$GT$9ghost_add17h4a513e9d32567c58E	@	namui-runtime-wasm.wasm:0x55901
$_ZN11namui_hooks7compose3ctx6public55_$LT$impl$u20$namui_hooks..compose..ctx..ComposeCtx$GT$10ghost_impl17ha31df9ea2ac84135E	@	namui-runtime-wasm.wasm:0x6a9df
$_ZN140_$LT$luda_editor_client..episode_editor..speaker_selector..SpeakerSelector$u20$as$u20$namui_hooks..component..component_trait..Component$GT$6render17h711db993ee133160E	@	namui-runtime-wasm.wasm:0x97579
$_ZN11namui_hooks7compose3ctx6public55_$LT$impl$u20$namui_hooks..compose..ctx..ComposeCtx$GT$9ghost_add17ha64eee37422ef4cdE	@	namui-runtime-wasm.wasm:0x78f32
$_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h9cef67150a46214dE.llvm.13902290766190171042	@	namui-runtime-wasm.wasm:0x421c3
$_ZN11namui_hooks7compose3ctx6public55_$LT$impl$u20$namui_hooks..compose..ctx..ComposeCtx$GT$10ghost_impl17haad6178e4a7f5d14E	@	namui-runtime-wasm.wasm:0x22f8fe
$_ZN107_$LT$namui_prebuilt..table..InternalSlice$u20$as$u20$namui_hooks..component..component_trait..Component$GT$6render17hb1222cbb852f9dd4E	@	namui-runtime-wasm.wasm:0x230a4e
$_ZN11namui_hooks7compose3ctx6public55_$LT$impl$u20$namui_hooks..compose..ctx..ComposeCtx$GT$9ghost_add17h4a513e9d32567c58E	@	namui-runtime-wasm.wasm:0x55901
$_ZN11namui_hooks7compose3ctx6public55_$LT$impl$u20$namui_hooks..compose..ctx..ComposeCtx$GT$10ghost_impl17h5d9ca6681b124da4E	@	namui-runtime-wasm.wasm:0x62a3b
$_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h1a66f3478c2f114cE.llvm.13902290766190171042	@	namui-runtime-wasm.wasm:0x3b205
$_ZN11namui_hooks7compose3ctx6public55_$LT$impl$u20$namui_hooks..compose..ctx..ComposeCtx$GT$10ghost_impl17haad6178e4a7f5d14E	@	namui-runtime-wasm.wasm:0x22f8fe
$_ZN107_$LT$namui_prebuilt..table..InternalSlice$u20$as$u20$namui_hooks..component..component_trait..Component$GT$6render17hb1222cbb852f9dd4E	@	namui-runtime-wasm.wasm:0x230a4e
$_ZN11namui_hooks7compose3ctx6public55_$LT$impl$u20$namui_hooks..compose..ctx..ComposeCtx$GT$9ghost_add17h4a513e9d32567c58E	@	namui-runtime-wasm.wasm:0x55901
$_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17ha32afe2c7e35f9f8E.llvm.13902290766190171042	@	namui-runtime-wasm.wasm:0x42eba
$_ZN11namui_hooks7compose3ctx6public55_$LT$impl$u20$namui_hooks..compose..ctx..ComposeCtx$GT$10ghost_impl17haad6178e4a7f5d14E	@	namui-runtime-wasm.wasm:0x22f8fe
$_ZN107_$LT$namui_prebuilt..table..InternalSlice$u20$as$u20$namui_hooks..component..component_trait..Component$GT$6render17hb1222cbb852f9dd4E	@	namui-runtime-wasm.wasm:0x230a4e
$_ZN11namui_hooks7compose3ctx6public55_$LT$impl$u20$namui_hooks..compose..ctx..ComposeCtx$GT$9ghost_add17h4a513e9d32567c58E	@	namui-runtime-wasm.wasm:0x55901
$_ZN11namui_hooks7compose3ctx6public55_$LT$impl$u20$namui_hooks..compose..ctx..ComposeCtx$GT$10ghost_impl17h0723b4a6498cd8cdE	@	namui-runtime-wasm.wasm:0x55d25
$_ZN126_$LT$luda_editor_client..episode_editor..LoadedEpisodeEditor$u20$as$u20$namui_hooks..component..component_trait..Component$GT$6render17h587e89a334d6a789E	@	namui-runtime-wasm.wasm:0x4c266
$_ZN11namui_hooks7compose3ctx6public55_$LT$impl$u20$namui_hooks..compose..ctx..ComposeCtx$GT$9ghost_add17hedb543849cf2f579E	@	namui-runtime-wasm.wasm:0x7ca90
$_ZN120_$LT$luda_editor_client..episode_editor..EpisodeEditor$u20$as$u20$namui_hooks..component..component_trait..Component$GT$6render17h278a50bbd7be3f2dE	@	namui-runtime-wasm.wasm:0x4bca9
$_ZN11namui_hooks7compose3ctx6public55_$LT$impl$u20$namui_hooks..compose..ctx..ComposeCtx$GT$9ghost_add17h60573a1ecddadcf3E	@	namui-runtime-wasm.wasm:0x817f7
$_ZN105_$LT$luda_editor_client..router..Router$u20$as$u20$namui_hooks..component..component_trait..Component$GT$6render17h234e168a3b762bd1E	@	namui-runtime-wasm.wasm:0xbd81c
$_ZN11namui_hooks7compose3ctx6public55_$LT$impl$u20$namui_hooks..compose..ctx..ComposeCtx$GT$9ghost_add17h10c87f6ba33527fdE	@	namui-runtime-wasm.wasm:0x78c57
$_ZN18luda_editor_client4main28_$u7b$$u7b$closure$u7d$$u7d$17h8c3fec0fb07ace47E	@	namui-runtime-wasm.wasm:0xd9dd0
$_ZN11namui_hooks5world6public43_$LT$impl$u20$namui_hooks..world..World$GT$8run_impl17h8c50de8024e79c62E	@	namui-runtime-wasm.wasm:0x271867
$_ZN5namui5hooks6looper6Looper4tick17hd742c617c6e9caf0E	@	namui-runtime-wasm.wasm:0x271aa4
$_ZN102_$LT$tokio..runtime..blocking..task..BlockingTask$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$4poll17h44d9ae355a802704E	@	namui-runtime-wasm.wasm:0xdad5c
$_ZN5tokio7runtime4task4core17Core$LT$T$C$S$GT$4poll17hdd86aedd4b8b8396E	@	namui-runtime-wasm.wasm:0xf5507
$_ZN5tokio7runtime4task7harness20Harness$LT$T$C$S$GT$10poll_inner17h778689b38c4679f3E	@	namui-runtime-wasm.wasm:0x9cfcf
$_ZN5tokio7runtime4task7harness20Harness$LT$T$C$S$GT$4poll17h856b317efa210a62E	@	namui-runtime-wasm.wasm:0xa7bcf
$_ZN5tokio7runtime4task3raw4poll17hedb1e99955a2e67aE	@	namui-runtime-wasm.wasm:0xb420c
$_ZN5tokio7runtime8blocking4pool5Inner3run17h1c589867989c3e10E	@	namui-runtime-wasm.wasm:0x49485e
$_ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17h8f9e1a15787d34afE	@	namui-runtime-wasm.wasm:0x492e39
$_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17ha8106037e68f2470E	@	namui-runtime-wasm.wasm:0x493613
$_ZN3std3sys3pal4wasi6thread6Thread3new12thread_start17hd24b564ceeb1602fE	@	namui-runtime-wasm.wasm:0x910ec7
$__wasi_thread_start_C	@	namui-runtime-wasm.wasm:0x964e43
$wasi_thread_start	@	namui-runtime-wasm.wasm:0x966379
self.onmessage

Steps to Reproduce

items.push(table::ratio(1, |_wh, _ctx| {}));
items.push(table::fit(table::FitAlign::LeftTop, |ctx| {
ctx.add(button::TextButtonFit {
height: wh.height,
text: "설정",
text_color: Color::WHITE,
stroke_color: Color::WHITE,
stroke_width: 1.px(),
fill_color: Color::BLACK,
side_padding: 8.px(),
mouse_buttons: vec![MouseButton::Left],
on_mouse_up_in: &|_event| todo!(),
});
}));

Other Info

let pixel_sizes = pixel_size_or_ratio_list.iter().map(|(pixel_size, ratio)| {

Error occurs here.
And if I change code like below, button goes crazy.

        let pixel_sizes = pixel_size_or_ratio_list.iter().map(|(pixel_size, ratio)| {
            if let Some(pixel_size) = pixel_size {
                *pixel_size
            } else if let Some(ratio) = ratio {
                (direction_pixel_size - non_ratio_pixel_size_sum) * *ratio / ratio_sum
            } else {
                0.px()
            }
        });

Animation

@bigfoodK bigfoodK added bug Something isn't working namui-prebuilt labels Oct 16, 2024
@namse namse self-assigned this Oct 17, 2024
@namse namse linked a pull request Oct 24, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working namui-prebuilt
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants