Skip to content

Commit

Permalink
Rendering bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
rsimon committed Mar 29, 2024
1 parent bed5202 commit 94d4d0d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/text-annotator/src/highlight/baseRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const createBaseRenderer = (

container.addEventListener('pointermove', onPointerMove);

const redraw = (lazy: boolean = true) => {
const redraw = (lazy: boolean = false) => {
if (customPainter)
customPainter.clear();

Expand Down Expand Up @@ -120,7 +120,7 @@ export const createBaseRenderer = (

const setFilter = (filter?: Filter) => {
currentFilter = filter;
redraw();
redraw(false);
}

// Refresh on store change
Expand Down
2 changes: 2 additions & 0 deletions packages/text-annotator/src/highlight/span/spansRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ const createRenderer = (container: HTMLElement): RendererImplementation => {
painter?: HighlightPainter,
lazy?: boolean
) => {
console.log('redraw, lazy =', lazy);

// Only redraw if annotations or annotation states changed
const noChanges = dequal(currentRendered, highlights);
if (noChanges && lazy) return;
Expand Down

0 comments on commit 94d4d0d

Please sign in to comment.