Skip to content

Commit

Permalink
refactor: optimize code
Browse files Browse the repository at this point in the history
  • Loading branch information
big-camel committed Nov 8, 2022
1 parent f1ee38c commit ffc04bb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/engine/src/ot/range-coloring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -670,8 +670,9 @@ class RangeColoring implements RangeColoringInterface {
}

updateBackgroundPosition() {
for (const child of BACKGROUND_TO_ELEMNT.values()) {
const node = $(child);
for (const node of BACKGROUND_TO_ELEMNT.values()) {
const child = node.get<HTMLElement>();
if (!child) continue;
const range = child['__range'];
const uuid = node.attributes(DATA_UUID);
const color = node.attributes(DATA_COLOR);
Expand Down

0 comments on commit ffc04bb

Please sign in to comment.