@@ -94,8 +94,7 @@ function init(dotNetHelper: DotNet.DotNetObject, spacerBefore: HTMLElement, spac
9494 // scrolling glitches.
9595 rangeBetweenSpacers . setStartAfter ( spacerBefore ) ;
9696 rangeBetweenSpacers . setEndBefore ( spacerAfter ) ;
97- const rangeRect = rangeBetweenSpacers . getBoundingClientRect ( ) ;
98- const spacerSeparation = rangeRect . height ;
97+ const spacerSeparation = rangeBetweenSpacers . getBoundingClientRect ( ) . height ;
9998 const containerSize = entry . rootBounds ?. height ;
10099
101100 // Accumulate scale factors from all parent elements as they multiply together
@@ -107,7 +106,7 @@ function init(dotNetHelper: DotNet.DotNetObject, spacerBefore: HTMLElement, spac
107106 const computedStyle = getComputedStyle ( element ) ;
108107
109108 // Check for zoom property (applies uniform scaling)
110- if ( computedStyle . zoom && computedStyle . zoom !== 'normal' && computedStyle . zoom !== ' 1') {
109+ if ( computedStyle . zoom && computedStyle . zoom !== '1' ) {
111110 scaleFactor *= parseFloat ( computedStyle . zoom ) ;
112111 }
113112
@@ -121,12 +120,10 @@ function init(dotNetHelper: DotNet.DotNetObject, spacerBefore: HTMLElement, spac
121120
122121 // Check for transform property (matrix form)
123122 if ( computedStyle . transform && computedStyle . transform !== 'none' ) {
124- // A 2D transform matrix has 6 values: matrix(scaleX, skewY, skewX, scaleY, translateX, translateY)
125- const match = computedStyle . transform . match ( / m a t r i x \( [ ^ , ] + , \s * [ ^ , ] + , \s * [ ^ , ] + , \s * ( [ ^ , ] + ) / ) ;
126- if ( match ) {
127- const scaleY = parseFloat ( match [ 1 ] ) ;
128- scaleFactor *= scaleY ;
129- }
123+ // Parse the transform matrix using DOMMatrix to extract scaleY
124+ const matrix = new DOMMatrix ( computedStyle . transform ) ;
125+ // For vertical scrolling, we only need the Y-axis scale factor (d/m22)
126+ scaleFactor *= matrix . d ;
130127 }
131128 element = element . parentElement ;
132129 }
0 commit comments