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

Implement touch events via winit #24

Merged
merged 2 commits into from
Jun 30, 2022

Conversation

marysaka
Copy link
Contributor

Tested on iOS

@wtholliday
Copy link
Contributor

Looks good! How do I run with winit on iOS?

@marysaka
Copy link
Contributor Author

marysaka commented Jun 27, 2022

Looks good! How do I run with winit on iOS?

I'm working on tools to build iOS app entirely in Rust without depending on xcode

This is currently unreleased but I'm using the example from the readme directly and it does work

use rui::*;

fn main() {
    rui(state(
        || 1,
        |count, cx| {
            vstack((
                cx[count].padding(Auto),
                button("increment", move |cx| {
                    cx[count] += 1;
                })
                .padding(Auto),
            ))
        },
    ));
}

Something to note however is that as it, position are broken on my iPhone 12.
winit will return the outer_size of the window on resize instead of the inner_size (rust-windowing/winit#2347)

My initial workaround is also not enough if you don't target iOS 7.0 as it seems wgpu entirely ignore the size you give to it and use the whole screen (ignoring safe areas).

I ended up forcing rui to use the outer_size everywhere instead and it does works that way. (see marysaka@6ee75ef)

wtholliday added a commit that referenced this pull request Jun 29, 2022
@marysaka
Copy link
Contributor Author

I fixed build issues with tao.

Also rebased on top of the main branch.

@wtholliday wtholliday merged commit f772c20 into audulus:main Jun 30, 2022
@wtholliday
Copy link
Contributor

Thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants