fix(app): stabilize canvas refresh and borders
Fast Refresh preserves refs while rerunning effects, so canceled paint requests must release their retained IDs or unseen diff regions stop rendering. Paint the final expanded body’s reserved boundary pixel because no following header owns that seam.
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
import { selectionRectangles } from "./hit-testing";
|
||||
import { fragmentWidthForRange, visibleRowRange } from "./model";
|
||||
import {
|
||||
DIFF_BODY_BORDER_HEIGHT,
|
||||
finalExpandedBodyBorderTop,
|
||||
fragmentWidthForRange,
|
||||
visibleRowRange,
|
||||
} from "./model";
|
||||
import { codeLineNumberTone, codeTextColor } from "./palette";
|
||||
import { reviewBackgroundPaint, reviewDividerHeight, reviewGapTop } from "./review-paint";
|
||||
import type {
|
||||
@@ -64,6 +69,17 @@ export function paintWebViewport(input: PaintWebViewportInput): void {
|
||||
});
|
||||
}
|
||||
|
||||
const finalBorderTop = finalExpandedBodyBorderTop(input.model);
|
||||
if (finalBorderTop !== null) {
|
||||
context.fillStyle = input.palette.border;
|
||||
context.fillRect(
|
||||
0,
|
||||
finalBorderTop - input.scrollTop,
|
||||
input.viewportWidth,
|
||||
DIFF_BODY_BORDER_HEIGHT,
|
||||
);
|
||||
}
|
||||
|
||||
if (input.selection) paintSelection(input, input.selection);
|
||||
context.restore();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user