Skip to content

Commit f3ab954

Browse files
authored
Merge pull request #300 from aaron1604/fix-margin-padding-fix-lottie
fix: margin padding for lottie
2 parents 7678ce0 + 6bea69f commit f3ab954

File tree

2 files changed

+29
-22
lines changed

2 files changed

+29
-22
lines changed

client/packages/lowcoder/src/comps/comps/jsonComp/jsonLottieComp.tsx

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -94,31 +94,36 @@ let JsonLottieTmpComp = (function () {
9494
};
9595
return new UICompBuilder(childrenMap, (props) => {
9696
return (
97-
<div
98-
style={{
99-
height: "100%",
100-
display: "flex",
101-
justifyContent: "center",
102-
backgroundColor: `${props.backgroundColor.background}`,
103-
}}
104-
>
105-
<Player
106-
key={
107-
[props.speed, props.animationStart, props.loop, props.value, props.keepLastFrame] as any
108-
}
109-
keepLastFrame={props.keepLastFrame}
110-
autoplay={props.animationStart === "auto" && true}
111-
hover={props.animationStart === "on hover" && true}
112-
loop={props.loop === "single" ? false : true}
113-
speed={Number(props.speed)}
114-
src={props.value}
97+
<div style={{
98+
padding: `${props.backgroundColor.margin}`,
99+
}}>
100+
<div
115101
style={{
116102
height: "100%",
117-
width: "100%",
118-
maxWidth: "100%",
119-
maxHeight: "100%",
103+
display: "flex",
104+
justifyContent: "center",
105+
backgroundColor: `${props.backgroundColor.background}`,
106+
padding: `${props.backgroundColor.padding}`
120107
}}
121-
/>
108+
>
109+
<Player
110+
key={
111+
[props.speed, props.animationStart, props.loop, props.value, props.keepLastFrame] as any
112+
}
113+
keepLastFrame={props.keepLastFrame}
114+
autoplay={props.animationStart === "auto" && true}
115+
hover={props.animationStart === "on hover" && true}
116+
loop={props.loop === "single" ? false : true}
117+
speed={Number(props.speed)}
118+
src={props.value}
119+
style={{
120+
height: "100%",
121+
width: "100%",
122+
maxWidth: "100%",
123+
maxHeight: "100%",
124+
}}
125+
/>
126+
</div>
122127
</div>
123128
);
124129
})

client/packages/lowcoder/src/comps/controls/styleControlConstants.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,8 @@ export const LottieStyle = [
878878
depType: DEP_TYPE.SELF,
879879
transformer: toSelf,
880880
},
881+
MARGIN,
882+
PADDING,
881883
] as const;
882884
/////////////////////
883885

0 commit comments

Comments
 (0)