Skip to content

Commit

Permalink
fix: revert to before fix 4-bit precision
Browse files Browse the repository at this point in the history
  • Loading branch information
qq15725 committed Nov 9, 2024
1 parent 763919e commit afeb6f6
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/copy-css-styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { getDefaultStyle } from './get-default-style'
import { getDiffStyle } from './get-diff-style'
import { IN_CHROME } from './utils'

const px4PrecisionRE = /^\d+\.\d{4}px$/

export function copyCssStyles<T extends HTMLElement | SVGElement>(
node: T,
cloned: T,
Expand Down Expand Up @@ -59,10 +57,6 @@ export function copyCssStyles<T extends HTMLElement | SVGElement>(
}

style.forEach(([value, priority], name) => {
// fix a typographic anomaly caused by getComputedStyle getting px values only to 4-bit precision
if (px4PrecisionRE.test(value)) {
value = `${Number.parseFloat(value) + 0.0001}px`
}
clonedStyle.setProperty(name, value, priority)
})

Expand Down

0 comments on commit afeb6f6

Please sign in to comment.