qtfb: fix scaled partial updates collapsing to empty rects - #66
Open
dcasselwork123 wants to merge 1 commit into
Open
qtfb: fix scaled partial updates collapsing to empty rects#66dcasselwork123 wants to merge 1 commit into
dcasselwork123 wants to merge 1 commit into
Conversation
FBController::markedUpdate computed the scaled update rect with integer division (rect.x() / image->width() == 0 for any x inside the image), so every partial update on an allowScaling canvas requested an empty repaint and the screen never changed; only MESSAGE_UPDATE/UPDATE_ALL repainted. Scale with qreal instead, flooring the origin and ceiling the size (+1px slop) so the damaged area is always covered. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
The bug
FBController::markedUpdate(const QRect&)computes the scaled repaint rect with integer division:(rect.x() / image->width()) * this->width()For any rect inside the framebuffer,
rect.x() / image->width()is0(and likewise the width/height terms), so on anallowScaling: truecanvas every partial update requests an empty repaint. Clients that useMESSAGE_UPDATE/UPDATE_PARTIALrender into the SHM correctly but the screen never changes; onlyUPDATE_ALL(which callsmarkedUpdate()with no rect) repaints.Observed on a reMarkable 2 (OS 3.27.1, AppLoad v0.5.3) with a native qtfb client: the app's initial full update painted, then all subsequent partial updates were silently dropped. Working around it client-side with
UPDATE_ALLper stroke makes writing latency unusable on the GPU-less rM2, since each update becomes a full-window software repaint.The fix
Scale in
qreal, flooring the origin and ceiling the size with 1px slop so the damaged area is always covered. Also guards against a zero-sized image.Tested on the rM2: partial updates repaint correctly and pen latency with a 35 ms update cadence is good.
🤖 Generated with Claude Code