@@ -17,7 +17,7 @@ export const assertDom = (measurement: Measurement) => {
1717
1818export interface PendingOutline {
1919 fiber : Fiber ; // todo, weak ref not always available
20- cachedMeasurement : Measurement ;
20+ latestMeasurement : Measurement ;
2121 renders : Render [ ] ;
2222}
2323
@@ -129,7 +129,7 @@ export const getOutline = (
129129 return {
130130 fiber : fiber ,
131131 renders : [ render ] ,
132- cachedMeasurement : {
132+ latestMeasurement : {
133133 kind : 'dom' ,
134134 value : rect ,
135135 } ,
@@ -140,7 +140,7 @@ export const mergeOutlines = (outlines: PendingOutline[]) => {
140140 const mergedOutlines = new Map < string , PendingOutline > ( ) ;
141141 for ( let i = 0 , len = outlines . length ; i < len ; i ++ ) {
142142 const outline = outlines [ i ] ;
143- const key = getOutlineKey ( assertDom ( outline . cachedMeasurement ) . value ) ;
143+ const key = getOutlineKey ( assertDom ( outline . latestMeasurement ) . value ) ;
144144 const existingOutline = mergedOutlines . get ( key ) ;
145145
146146 if ( ! existingOutline ) {
@@ -173,7 +173,7 @@ export const recalcOutlines = throttle(() => {
173173 scheduledOutlines . splice ( i , 1 ) ;
174174 continue ;
175175 }
176- outline . cachedMeasurement . value = rect ;
176+ outline . latestMeasurement . value = rect ;
177177 }
178178
179179 for ( let i = activeOutlines . length - 1 ; i >= 0 ; i -- ) {
@@ -187,7 +187,7 @@ export const recalcOutlines = throttle(() => {
187187 activeOutlines . splice ( i , 1 ) ;
188188 continue ;
189189 }
190- outline . cachedMeasurement . value = rect ;
190+ outline . latestMeasurement . value = rect ;
191191 }
192192} , DEFAULT_THROTTLE_TIME ) ;
193193
@@ -238,7 +238,7 @@ export const flushOutlines = (
238238
239239 await Promise . all (
240240 mergedOutlines . map ( async ( outline ) => {
241- const key = getOutlineKey ( assertDom ( outline . cachedMeasurement ) . value ) ;
241+ const key = getOutlineKey ( assertDom ( outline . latestMeasurement ) . value ) ;
242242 if ( previousOutlines . has ( key ) ) {
243243 return ;
244244 }
@@ -270,11 +270,11 @@ export const paintOutline = (
270270 log ( outline . renders ) ;
271271 }
272272
273- const key = getOutlineKey ( assertDom ( outline . cachedMeasurement ) . value ) ; // todo: fix for dom
273+ const key = getOutlineKey ( assertDom ( outline . latestMeasurement ) . value ) ; // todo: fix for dom
274274 const existingActiveOutline = ReactScanInternals . activeOutlines . find (
275275 ( activeOutline ) =>
276276 getOutlineKey (
277- assertDom ( activeOutline . outline . cachedMeasurement ) . value ,
277+ assertDom ( activeOutline . outline . latestMeasurement ) . value ,
278278 ) === key ,
279279 ) ;
280280
@@ -293,8 +293,8 @@ export const paintOutline = (
293293
294294 if ( existingActiveOutline ) {
295295 existingActiveOutline . outline . renders . push ( ...outline . renders ) ;
296- existingActiveOutline . outline . cachedMeasurement =
297- outline . cachedMeasurement ;
296+ existingActiveOutline . outline . latestMeasurement =
297+ outline . latestMeasurement ;
298298 existingActiveOutline . frame = 0 ;
299299 existingActiveOutline . totalFrames = totalFrames ;
300300 existingActiveOutline . alpha = alpha ;
@@ -350,10 +350,10 @@ export const fadeOutOutline = (ctx: CanvasRenderingContext2D) => {
350350 }
351351 const newRect = getRect ( domNode ) ;
352352 if ( newRect ) {
353- outline . cachedMeasurement . value = newRect ;
353+ outline . latestMeasurement . value = newRect ;
354354 }
355355 } ) ;
356- const { value : rect } = assertDom ( outline . cachedMeasurement ) ;
356+ const { value : rect } = assertDom ( outline . latestMeasurement ) ;
357357 const unstable = isOutlineUnstable ( outline ) ;
358358
359359 const alphaScalar = unstable ? 0.8 : 0.2 ;
@@ -393,7 +393,7 @@ export const fadeOutOutline = (ctx: CanvasRenderingContext2D) => {
393393
394394 for ( let i = 0 , len = pendingLabeledOutlines . length ; i < len ; i ++ ) {
395395 const { alpha, outline, text } = pendingLabeledOutlines [ i ] ;
396- const { value : rect } = assertDom ( outline . cachedMeasurement ) ; // todo: fix for dom
396+ const { value : rect } = assertDom ( outline . latestMeasurement ) ; // todo: fix for dom
397397 ctx . save ( ) ;
398398
399399 if ( text ) {
0 commit comments