From b41f39bd98f929fee3227f55a5882ab5a2b3ebcc Mon Sep 17 00:00:00 2001 From: pissang Date: Fri, 14 May 2021 14:14:24 +0800 Subject: [PATCH] test(transform): optimize css baseline in origin test --- test/origin.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/origin.html b/test/origin.html index 591a897ac..b36681e08 100644 --- a/test/origin.html +++ b/test/origin.html @@ -19,6 +19,7 @@ #css-baseline-container>div { position: absolute; border: 2px solid red; + box-sizing: border-box; } #description { position: absolute; @@ -138,11 +139,9 @@ baselineContainer.appendChild(baselineBox); // rotation and skewY in zrender has different direction with CSS transform. baselineBox.style.cssText = ` -left: ${offsetX + cellSize * column}px; -top: ${offsetY + row * cellSize}px; width: ${elSize}px; height: ${elSize}px; -transform: rotate(${-rot}deg) skew(${skew[0]}deg, ${-skew[1]}deg) scale(${scale[0]}, ${scale[1]}); +transform: translate(${offsetX + cellSize * column}px, ${offsetY + row * cellSize}px) rotate(${-rot}deg) skew(${skew[0]}deg, ${-skew[1]}deg) scale(${scale[0]}, ${scale[1]}); transform-origin: ${origin[0] * 100}% ${origin[1] * 100}%; `