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] Manual WebView resizing does not work correctly #10053

Open
kanatapple opened this issue Jun 13, 2024 · 2 comments
Open

[bug] Manual WebView resizing does not work correctly #10053

kanatapple opened this issue Jun 13, 2024 · 2 comments
Labels
scope: unstable flag Issue only occures with "unstable" feature flag enabled status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@kanatapple
Copy link
Contributor

Describe the bug

Manually resizing the WebView(set_size) results in incorrect positioning of the WebView.
However, if the WebView coordinates are set to (0., 0.), it works correctly.

https://youtu.be/02gJWTb1Hjg

Reproduction

https://github.com/kanatapple/tauri-manual-resize

Expected behavior

No response

Full tauri info output

[✔] Environment
    - OS: Windows 10.0.19045 X64
    ✔ WebView2: 125.0.2535.92
    ✔ MSVC:
        - Visual Studio Professional 2017
        - Visual Studio Professional 2019
    ✔ rustc: 1.77.2 (25ef9e3d8 2024-04-09)
    ✔ cargo: 1.77.2 (e52e36006 2024-03-26)
    ✔ rustup: 1.27.0 (bbb9276d2 2024-03-08)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 20.11.0
    - yarn: 1.22.11
    - npm: 10.2.4

[-] Packages
    - tauri [RUST]: 2.0.0-beta.22
    - tauri-build [RUST]: 2.0.0-beta.17
    - wry [RUST]: 0.40.1
    - tao [RUST]: 0.28.1
    - tauri-cli [RUST]: 1.2.3
    - @tauri-apps/api [NPM]: 2.0.0-beta.13
    - @tauri-apps/cli [NPM]: 2.0.0-beta.20

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - bundler: Vite

Stack trace

No response

Additional context

No response

@kanatapple kanatapple added status: needs triage This issue needs to triage, applied to new issues type: bug labels Jun 13, 2024
@kanatapple kanatapple changed the title [bug] Manually resize WebView [bug] Manual WebView resizing does not work correctly Jun 13, 2024
@FabianLars FabianLars added the scope: unstable flag Issue only occures with "unstable" feature flag enabled label Jun 13, 2024
@kanatapple
Copy link
Contributor Author

If the initial position is (1, 1) and scale_factor is 1.5 (150%), the position becomes (2, 2) in set_bounds .
In bounds.position.to_physical it becomes (1.5, 1.5), but it is cast to (2, 2).

After that, the position seems to increase from (2, 2) -> (3, 3), (3, 3) -> (5, 5), and so on.

@kanatapple
Copy link
Contributor Author

kanatapple commented Jun 20, 2024

Now that I know the cause, I'll send a Pull Request later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: unstable flag Issue only occures with "unstable" feature flag enabled status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

2 participants