Skip to content

Commit 67e70e2

Browse files
committed
fix: fix cr issues
1 parent a42ee22 commit 67e70e2

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

src/designs/structures/list-zigzag.tsx

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,6 @@ const createListZigzag = (config: ZigzagConfig) => {
222222
}
223223
const btnX = anchor.x - btnBounds.width / 2;
224224
const btnY = anchor.y - btnBounds.height / 2;
225-
const offsetX = Math.max(0, -btnX);
226-
const offsetY = Math.max(0, -btnY);
227225
return (
228226
<FlexLayout
229227
id="infographic-container"
@@ -232,7 +230,7 @@ const createListZigzag = (config: ZigzagConfig) => {
232230
alignItems="center"
233231
>
234232
{titleContent}
235-
<Group x={offsetX} y={offsetY}>
233+
<Group>
236234
<Arrow colorPrimary={colorPrimary} colorShadow={colorShadow} />
237235
<ItemsGroup />
238236
<BtnsGroup>
@@ -289,16 +287,8 @@ const createListZigzag = (config: ZigzagConfig) => {
289287
const addOffset =
290288
Math.max(itemBounds.width, itemBounds.height) * 0.45 + itemGap;
291289

292-
let minX = 0;
293-
let minY = 0;
294-
const trackMin = (x: number, y: number) => {
295-
if (x < minX) minX = x;
296-
if (y < minY) minY = y;
297-
};
298-
299290
const toItemPosition = (point: AnchorPoint) => {
300291
const { x, y, centerY } = getAnchoredPosition(point, itemBounds);
301-
trackMin(x, y);
302292
return { x, y, centerY };
303293
};
304294

@@ -325,7 +315,6 @@ const createListZigzag = (config: ZigzagConfig) => {
325315
const btnRemoveY = isTop
326316
? itemPosition.y - btnBounds.height / 2
327317
: itemPosition.y + itemBounds.height - btnBounds.height / 2;
328-
trackMin(btnRemoveX, btnRemoveY);
329318
btnElements.push(
330319
<BtnRemove indexes={indexes} x={btnRemoveX} y={btnRemoveY} />,
331320
);
@@ -337,7 +326,6 @@ const createListZigzag = (config: ZigzagConfig) => {
337326
firstAnchor.x - startDirection.x * addOffset - btnBounds.width / 2;
338327
const firstAddY =
339328
firstAnchor.y - startDirection.y * addOffset - btnBounds.height / 2;
340-
trackMin(firstAddX, firstAddY);
341329
btnElements.push(<BtnAdd indexes={[0]} x={firstAddX} y={firstAddY} />);
342330

343331
for (let index = 0; index < anchorPoints.length - 1; index++) {
@@ -347,7 +335,6 @@ const createListZigzag = (config: ZigzagConfig) => {
347335
const midY = (current.y + next.y) / 2;
348336
const midAddX = midX - btnBounds.width / 2;
349337
const midAddY = midY - btnBounds.height / 2;
350-
trackMin(midAddX, midAddY);
351338
btnElements.push(
352339
<BtnAdd indexes={[index + 1]} x={midAddX} y={midAddY} />,
353340
);
@@ -358,7 +345,6 @@ const createListZigzag = (config: ZigzagConfig) => {
358345
lastAnchor.x + endDirection.x * addOffset - btnBounds.width / 2;
359346
const lastAddY =
360347
lastAnchor.y + endDirection.y * addOffset - btnBounds.height / 2;
361-
trackMin(lastAddX, lastAddY);
362348
btnElements.push(
363349
<BtnAdd indexes={[layoutCount]} x={lastAddX} y={lastAddY} />,
364350
);

0 commit comments

Comments
 (0)