Use translate3d for layout transforms to trick browser into using GPU acceleration (#85)

This commit is contained in:
Evan Simkowitz 2024-06-27 14:36:58 -07:00 committed by GitHub
parent 23e1c8797d
commit c9cf88eb5e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -83,7 +83,7 @@ export function determineDropDirection(dimensions?: Dimensions, offset?: XYCoord
export function setTransform({ top, left, width, height }: Dimensions, setSize: boolean = true): CSSProperties {
// Replace unitless items with px
const translate = `translate(${left}px,${top}px)`;
const translate = `translate3d(${left}px,${top}px, 0)`;
return {
top: 0,
left: 0,