Fix(Whiteboard): Fixed onSizeChanged and implemented testcase#20617
Fix(Whiteboard): Fixed onSizeChanged and implemented testcase#20617LUwUcifer wants to merge 1 commit intoankidroid:mainfrom
Conversation
|
Lint is falling. See: https://github.com/ankidroid/Anki-Android/tree/main/.github/workflows#quality-checks |
|
@LUwUcifer You might want to add the copyright header in the new file, similar to other files. It should fix the Lint check 👍 |
415178e to
62b07ec
Compare
62b07ec to
005872e
Compare
|
@david-allison fine to check now |
|
Please produce a before/after video. It's been a while since Uni, I suspect the math is good, but a video provides much better confidence without a bit of revision. |
|
@BrayanDSO this doesn't look right to me, I'll defer to your judgment of a 'correct' implementation here |
|
This was the implementation in the previous study screen in Whiteboard.kt as well, I agree the application does not look visually appealing and have made a feature suggestion post in the anki forum earlier |
|
That's a consequence of having a non-infinite drawing space that can vary. Between moving stuff out of bounds and resizing (which also means changing) the user's drawing, I prefer the former, because it doesn't modify anything and the implementation is simpler. |
|
Change in Orientation on most devices will usually move half the drawing space out of bounds, I agree remapping in ratio is not the best option and would like to work towards a resizing feature as I suggested on the forum, lmk if you would like changes to this PR or if I should close it |
Purpose / Description
Issue as described in #20616
Fixes
Approach
Utilises matrix transform to correct the bitmap
https://developer.android.com/reference/android/graphics/Path#transform(android.graphics.Matrix)
How Has This Been Tested?
Tested on local device as well as emulator, testcase fails for old implementation
Learning (optional, can help others)
Requesting a thorough review of the test file as it has been implemented through a vague understanding of implementation from other repositories
AI Disclaimer: Github Copilot in github was used to search for other repositories testcases for research
Links to blog posts, patterns, libraries or addons used to solve this problem
Checklist
Please, go through these checks before submitting the PR.