Closed
Conversation
a38aafc to
6d6b502
Compare
LogDetails |
Contributor
Author
|
/gemini review |
Comment on lines
+107
to
+112
| if (tag === Shape) { | ||
| if (type === 'circular') { | ||
| return <group style={{ x: left, y: top, ...itemStyle }}>{child}</group>; | ||
| } | ||
| return child; | ||
| } |
Comment on lines
+115
to
+123
| <group | ||
| style={{ | ||
| width, | ||
| height, | ||
| ...itemStyle, | ||
| }} | ||
| > | ||
| {child} | ||
| </group> |
There was a problem hiding this comment.
left 和 top 定位属性没有应用到子组件上。这里计算出的 left 和 top 值没有在包裹的 <group> 组件的 style 中使用,导致子组件的位置不正确。
另外,在 getLayoutStyle 方法中使用了 display: 'flex',这与手动计算 left/top 的绝对定位方式存在冲突。建议统一采用一种布局方式。如果采用手动定位,应从 getLayoutStyle 中移除 flex 相关属性,并在这里正确应用 x 和 y 坐标。
<group
style={{
x: left,
y: top,
width,
height,
...itemStyle,
}}
>
{child}
</group>
| const itemWidth = (containerWidth - totalGapWidth) / columns; | ||
| width = itemWidth; | ||
| left = col * (itemWidth + horizontalGap); | ||
| top = row * (height + verticalGap); |
Comment on lines
+102
to
+103
| left = containerWidth / 2 + radius * Math.cos(angle); | ||
| top = containerHeight / 2 + radius * Math.sin(angle); |
| const canvas = new Canvas(props); | ||
| await canvas.render(); | ||
|
|
||
| await delay(1000); |
Contributor
Author
|
没想好 下次吧 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
npm testpassesDescription of change