Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd766a34

Browse files
committed
designed formula to calculate padding dynamically
1 parent3cedced commitd766a34

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

‎client/packages/lowcoder/src/comps/comps/imageComp.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ const childrenMap = {
169169
animationStyle:styleControl(AnimationStyle),
170170
autoHeight:withDefault(AutoHeightControl,"fixed"),
171171
supportPreview:BoolControl,
172+
restrictPaddingOnRotation:withDefault(BoolControl,true)
172173
};
173174

174175
letImageBasicComp=newUICompBuilder(childrenMap,(props)=>{

‎client/packages/lowcoder/src/comps/generators/uiCompBuilder.tsx‎

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ function UIView(props: {
248248

249249
letdefaultChildren=comp.children;
250250
constisNotContainer=defaultChildren.hasOwnProperty('style');
251+
constrestrictPaddingOnRotation=defaultChildren.hasOwnProperty('restrictPaddingOnRotation');
251252
letrotationVal=null
252253
letboxShadowVal=null;
253254
if(isNotContainer){
@@ -263,17 +264,24 @@ function UIView(props: {
263264
width:'100%',
264265
height:'100%',
265266
margin:'0px',
266-
padding:
267-
rotationVal===null||rotationVal===undefined
268-
?'0px'
269-
:boxShadowVal===null||boxShadowVal===undefined
270-
?rotationVal===''||rotationVal==='0deg'
271-
?'0px'
272-
:'50% 0px'
273-
:(rotationVal===''||rotationVal==='0deg')&&
274-
(boxShadowVal===''||boxShadowVal==='0px')
275-
?'0px'
276-
:'50% 0px',
267+
// padding:'0px',
268+
padding:(
269+
rotationVal===null||rotationVal===undefined||restrictPaddingOnRotation
270+
?'0px'
271+
:(
272+
boxShadowVal===null||boxShadowVal===undefined
273+
?(
274+
rotationVal===''||rotationVal==='0deg'
275+
?'0px'
276+
:`calc(min(50%,${Math.min(50,Math.abs(rotationVal.replace('deg',''))/90)*100}%)) 0px`
277+
)
278+
:(
279+
(rotationVal===''||rotationVal==='0deg')&&(boxShadowVal===''||boxShadowVal==='0px')
280+
?'0px'
281+
:`calc(min(50%,${Math.min(50,Math.abs(rotationVal.replace('deg',''))/90)*100}%)) 0px`
282+
)
283+
)
284+
)
277285
}}
278286
>
279287
<HidableViewhidden={childrenProps.hiddenasboolean}>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp