Conversation
The camera was producing portrait-oriented photos when the tablet was held landscape, and the captured photo showed more content than what was visible in the preview. Root cause: SCREEN_WIDTH/SCREEN_HEIGHT were static module-level values that did not update on rotation, causing screenAspectRatio to be < 1 (portrait) — which doesn't match any landscape camera sensor format. - Use useWindowDimensions() for reactive dimensions that update on rotation - Calculate screenAspectRatio as max/min to always be >= 1, matching camera sensor formats (e.g. 4:3 = 1.33, 16:9 = 1.77) - Fix ESLint errors: == → ===, merge duplicate imports in useIsForeground.ts and usePreferredCameraDevice.ts - Fix .eslintrc.js: exclude jest plugin (incompatible with Node 22 / ESLint 8) - Bump version to 1.1.2 Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When the tablet was held in landscape, the camera produced portrait-oriented photos, and the captured photo showed more content than what was visible in the preview.
Root cause:
SCREEN_WIDTH/SCREEN_HEIGHTinConstants.tswere static module-level values that never updated on rotation. In landscape this madescreenAspectRatiosmaller than 1 (portrait), which does not match any landscape camera sensor format, souseCameraFormatpicked a mismatching format.Changes
useWindowDimensions()inCameraPageso the dimensions are reactive and update on rotationscreenAspectRatioasmax / minso it is always >= 1, matching camera sensor formats (4:3 = 1.33, 16:9 = 1.77)==->===, merge duplicate imports inuseIsForeground.tsandusePreferredCameraDevice.ts.eslintrc.js: exclude the jest plugin, which is incompatible with Node 22 / ESLint 8 in this setupBuilt and used with Mendix 10.24 / native template 14.1.
A follow-up PR will remove the dependency on
react-native-vector-icons, which is no longer part of the Mendix native template since version 19 (Studio Pro 11.10 and up) and currently breaks the bundling step there.🤖 Generated with Claude Code