Skip to content

Commit 6bea69f

Browse files
author
Aqib Mirza
committed
fix: margin padding for lottie
1 parent 7678ce0 commit 6bea69f

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy