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

fix(barcode-scanning): incorrect coordinate calculation on iOS #127

Merged
merged 3 commits into from
Feb 16, 2024

Conversation

robingenz
Copy link
Member

@robingenz robingenz commented Feb 15, 2024

Pull request checklist

Please check if your PR fulfills the following requirements:

  • The changes have been tested successfully.
  • A changeset has been created (npm run changeset).
  • I have read and followed the pull request guidelines.

@robingenz robingenz added bug/fix Something isn't working package: barcode-scanning labels Feb 15, 2024
@robingenz robingenz self-assigned this Feb 15, 2024
@robingenz robingenz marked this pull request as ready for review February 16, 2024 08:11
@robingenz
Copy link
Member Author

npm i @capacitor-mlkit/[email protected]

@robingenz robingenz merged commit 454bad4 into main Feb 16, 2024
2 checks passed
@robingenz robingenz deleted the fix/barcode-scanner/improve-coord-calculation branch February 16, 2024 08:25
@github-actions github-actions bot mentioned this pull request Feb 16, 2024
@robingenz
Copy link
Member Author

Android:

  • Viewport Width: 412
  • Viewport Height: 840
  • Screen Width: 1080
  • Screen Height: 2205
  • Image Width: 640
  • Image Height: 480
  • Scale = 3.4453125
  • window.devicePixelRatio = 2.625

iOS:

  • Viewport Width: 390
  • Viewport Height: 844
  • Potrait:
    • Screen Width: 390
    • Screen Height: 844
    • Image Width: 1280
    • Image Height: 720
    • Invisible Width: 84.75
    • Invisible Height: 0
  • Landscape:
    • Screen Width: 844
    • Screen Height: 390
    • Image Width: 1280
    • Image Height: 720
    • Invisible Width: 0
    • Invisible Height: 84.75
  • Scale: 3
  • window.devicePixelRatio = 3

Viewport Width: Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0)
Viewport Height: Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0)

Attention:

  • In Potrait mode: First corner point top right
  • In landscape mode: First corner point top left
  • On iOS, the coordinates only need to be scaled so that it is consistent as on Android

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

Successfully merging this pull request may close these issues.

1 participant