fix: the rendering order of transform and clip effects

Rendering clip effects before rendering transform effects would lead to a wrong clip area.
This commit is contained in:
Zihan 2022-02-10 11:01:38 +08:00 committed by GitHub
parent 6020386bbe
commit deb033ecff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -70,7 +70,6 @@ export class ElementPaint {
while (parent) {
const croplessEffects = parent.effects.filter((effect) => !isClipEffect(effect));
if (inFlow || parent.container.styles.position !== POSITION.STATIC || !parent.parent) {
effects.unshift(...croplessEffects);
inFlow = [POSITION.ABSOLUTE, POSITION.FIXED].indexOf(parent.container.styles.position) === -1;
if (parent.container.styles.overflowX !== OVERFLOW.VISIBLE) {
const borderBox = calculateBorderBoxPath(parent.curves);
@ -81,6 +80,7 @@ export class ElementPaint {
);
}
}
effects.unshift(...croplessEffects);
} else {
effects.unshift(...croplessEffects);
}