mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
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:
parent
6020386bbe
commit
deb033ecff
@ -70,7 +70,6 @@ export class ElementPaint {
|
|||||||
while (parent) {
|
while (parent) {
|
||||||
const croplessEffects = parent.effects.filter((effect) => !isClipEffect(effect));
|
const croplessEffects = parent.effects.filter((effect) => !isClipEffect(effect));
|
||||||
if (inFlow || parent.container.styles.position !== POSITION.STATIC || !parent.parent) {
|
if (inFlow || parent.container.styles.position !== POSITION.STATIC || !parent.parent) {
|
||||||
effects.unshift(...croplessEffects);
|
|
||||||
inFlow = [POSITION.ABSOLUTE, POSITION.FIXED].indexOf(parent.container.styles.position) === -1;
|
inFlow = [POSITION.ABSOLUTE, POSITION.FIXED].indexOf(parent.container.styles.position) === -1;
|
||||||
if (parent.container.styles.overflowX !== OVERFLOW.VISIBLE) {
|
if (parent.container.styles.overflowX !== OVERFLOW.VISIBLE) {
|
||||||
const borderBox = calculateBorderBoxPath(parent.curves);
|
const borderBox = calculateBorderBoxPath(parent.curves);
|
||||||
@ -81,6 +80,7 @@ export class ElementPaint {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
effects.unshift(...croplessEffects);
|
||||||
} else {
|
} else {
|
||||||
effects.unshift(...croplessEffects);
|
effects.unshift(...croplessEffects);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user