feat: Apply padding top when animating elements, b=(no-bug), c=workspaces

This commit is contained in:
Mr. M
2025-05-18 11:26:59 +02:00
parent ab69ab8f80
commit fe0e5a9101

View File

@@ -2096,11 +2096,13 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
const offset = -(newWorkspaceIndex - elementWorkspaceIndex) * 100; const offset = -(newWorkspaceIndex - elementWorkspaceIndex) * 100;
const newTransform = `translateX(${offset}%)`; const newTransform = `translateX(${offset}%)`;
if (shouldAnimate) { if (shouldAnimate) {
const existingPaddingTop = element.style.paddingTop;
animations.push( animations.push(
gZenUIManager.motion.animate( gZenUIManager.motion.animate(
element, element,
{ {
transform: existingTransform ? [existingTransform, newTransform] : newTransform, transform: existingTransform ? [existingTransform, newTransform] : newTransform,
paddingTop: existingTransform ? [existingPaddingTop, existingPaddingTop] : existingPaddingTop,
}, },
{ {
type: 'spring', type: 'spring',