Fix Active Area Calculation#37
Conversation
Code Coverage Report
|
There was a problem hiding this comment.
Pull request overview
This PR adjusts how the drawing “active area” (limit + exclusion rects) is calculated for Onyx/EPD devices, aiming to better match the raw hardware coordinate space (e.g., when device DPI/app-optimization scaling is enabled).
Changes:
- Added a helper to scale logical screen rectangles into “hardware pixel” rectangles using real display metrics.
- Updated
setExclusionRects()to use global visible bounds and pass scaled (hardware-mapped) limit/exclusion rects intoTouchHelper. - Updated touch helper setup to reuse
setExclusionRects()rather than re-applying limit rect logic separately.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
✅ APK Build Successful! An admin triggered a release build for this PR. You can download the generated APK here: Download APK |
|
✅ APK Build Successful! An admin triggered a release build for this PR. You can download the generated APK here: Download APK |
|
Hi! I tested this PR on Onyx BOOX Note Air 1 and unfortunately it doesn't resolve the issue on my device. Why it still fails on Note Air 1The What Onyx does at 350 DPI: Proposed fixAdd a fallback that detects this mode by comparing private fun scaleRectForEpd(rect: Rect): Rect {
val wm = context.getSystemService(android.content.Context.WINDOW_SERVICE) as android.view.WindowManager
val realMetrics = android.util.DisplayMetrics()
@Suppress("DEPRECATION")
wm.defaultDisplay.getRealMetrics(realMetrics)
val lm = context.resources.displayMetrics
var scaleX = realMetrics.widthPixels.toFloat() / lm.widthPixels
var scaleY = realMetrics.heightPixels.toFloat() / lm.heightPixels
if (scaleX < 1.05f && lm.xdpi > 0f && lm.densityDpi > lm.xdpi * 1.1f) {
scaleX = lm.density
scaleY = lm.density
}
if (scaleX <= 1.0f && scaleY <= 1.0f) return rect
return Rect(
kotlin.math.floor(rect.left * scaleX.toDouble()).toInt(),
kotlin.math.floor(rect.top * scaleY.toDouble()).toInt(),
kotlin.math.ceil(rect.right * scaleX.toDouble()).toInt(),
kotlin.math.ceil(rect.bottom * scaleY.toDouble()).toInt(),
)
}Logic:
I also changed Tested and working on Note Air 1. Full diff: dezwit@6274d44 |
|
@copilot update this PR with improvemnts proposed in #37 (comment) and dezwit@6274d44 The 1.1 difference fix is a bit weird, so I wonder if there's a cleaner approach. |
Agent-Logs-Url: https://github.com/alexdremov/notate/sessions/4a4cc63c-0006-4e57-bd82-70d37340a024 Co-authored-by: alexdremov <25539425+alexdremov@users.noreply.github.com>
Agent-Logs-Url: https://github.com/alexdremov/notate/sessions/4a4cc63c-0006-4e57-bd82-70d37340a024 Co-authored-by: alexdremov <25539425+alexdremov@users.noreply.github.com>
Implemented in No UI-visible changes in this update (logic-only), so there’s no UI screenshot to attach. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
✅ APK Build Successful! An admin triggered a release build for this PR. You can download the generated APK here: Download APK |
Thanks for the debugging, @dezwit! A subtle bug indeed. I (copilot) have incorporated fixes into this PR. Please try this APK. I have tested that this does not introduce any problems on my device. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
.github/workflows/release.yml:46
- The
Decode Keystorestep will attempt to base64-decode even whenKEYSTORE_BASE64isn’t available (e.g., fork PRs), which typically fails the job. If you keep PR builds, make this step conditional on the secret being present and skip signing/build an alternative artifact when it isn’t.
# Decode the Keystore from Secrets
- name: Decode Keystore
env:
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
run: |
echo "$KEYSTORE_BASE64" | base64 --decode > release.keystore
# Create keystore.properties
echo "storeFile=../release.keystore" > keystore.properties
echo "keyAlias=${{ secrets.KEY_ALIAS }}" >> keystore.properties
echo "storePassword=${{ secrets.STORE_PASSWORD }}" >> keystore.properties
echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> keystore.properties
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
✅ APK Build Successful! An admin triggered a release build for this PR. You can download the generated APK here: Download APK |
|
Unfortunately, this version of the app doesn't solve the problem for me. I'll try to find a fix. |
Fixes #36