Skip to content

Commit

Permalink
feat: add roundPadding, isDisplayShadowRoundControls #761 #762
Browse files Browse the repository at this point in the history
  • Loading branch information
daybrush committed Oct 17, 2022
1 parent f1ad4af commit 68be2e8
Show file tree
Hide file tree
Showing 7 changed files with 292 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,12 @@ export default {
},
dragStart(moveable: MoveableManagerInterface<BeforeRenderableProps>, e: any) {
this.setTransform(moveable, e);
this.resetStyle(e);

triggerEvent(moveable, `onBeforeRenderStart`, this.fillDragStartParams(moveable, e));
},
drag(moveable: MoveableManagerInterface<BeforeRenderableProps>, e: any) {
this.resetStyle(e);
const datas = e.datas;

datas.nextStyle = {};
triggerEvent(moveable, `onBeforeRender`, fillParams<OnBeforeRender>(moveable, e, {
isPinch: !!e.isPinch,
}));
Expand All @@ -94,6 +92,8 @@ export default {
const childMoveable = moveables[i];

this.setTransform(childMoveable, childEvent);
this.resetStyle(childEvent);

return this.fillDragStartParams(childMoveable, childEvent);
});
triggerEvent(moveable, `onBeforeRenderGroupStart`, fillParams<OnBeforeRenderGroupStart>(moveable, e, {
Expand All @@ -112,9 +112,6 @@ export default {
const childMoveable = moveables[i];

this.resetStyle(childEvent);
const datas = e.datas;

datas.nextStyle = {};
return this.fillDragParams(childMoveable, childEvent);
});
triggerEvent(moveable, `onBeforeRenderGroup`, fillParams<OnBeforeRenderGroup>(moveable, e, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,12 @@ function getClipStyles(
const [subWidth, subHeight] = minus(poses[4], poses[0]);

clipStyles.push("round", ...getRadiusStyles(
poses.slice(8),
clipPoses.slice(8),
clipPoses.slice(8).map((info, i) => {
return {
...info,
pos: poses[i],
};
}),
clipRelative!,
subWidth,
subHeight,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ export default {
isDrag: e.isDrag,
targets: moveable.props.targets,
events: params,
transform: getNextTransformText(e),
...fillCSSObject(getNextStyle(e)),
}));
},
dragControlStart(moveable: MoveableManagerInterface<RenderableProps>, e: any) {
Expand Down Expand Up @@ -107,6 +109,8 @@ export default {
return fillParams<OnRenderEnd>(moveable, e, {
isPinch: !!e.isPinch,
isDrag: e.isDrag,
transform: getNextTransformText(e),
...fillCSSObject(getNextStyle(e)),
});
},
} as const;
Loading

0 comments on commit 68be2e8

Please sign in to comment.