fix: 🐛 修正抽中卡片的位置
This commit is contained in:
2
src-tauri/Cargo.lock
generated
2
src-tauri/Cargo.lock
generated
@@ -77,7 +77,7 @@ checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "app"
|
name = "app"
|
||||||
version = "0.6.0-1"
|
version = "0.6.0-2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"log",
|
"log",
|
||||||
"serde",
|
"serde",
|
||||||
|
|||||||
@@ -322,7 +322,7 @@ export function useElementPosition(
|
|||||||
// 修改此处逻辑,确保当length=2时,两行围绕中心点对称分布
|
// 修改此处逻辑,确保当length=2时,两行围绕中心点对称分布
|
||||||
centerPosition.y = windowSize.height / 2 - totalHeight / 2
|
centerPosition.y = windowSize.height / 2 - totalHeight / 2
|
||||||
|
|
||||||
yTable = centerPosition.y + currentRow * verticalSpacing + centerYOffset + scaledCardHeight / 2 // 添加卡片高度的一半作为修正
|
yTable = centerPosition.y + currentRow * verticalSpacing + centerYOffset // 添加卡片高度的一半作为修正
|
||||||
// 计算当前行的水平居中偏移
|
// 计算当前行的水平居中偏移
|
||||||
const horizontalSpacing = scaledCardWidth * 1.2 // 水平间距基于缩放后的宽度
|
const horizontalSpacing = scaledCardWidth * 1.2 // 水平间距基于缩放后的宽度
|
||||||
const rowWidth = (cardsInCurrentRow - 1) * horizontalSpacing
|
const rowWidth = (cardsInCurrentRow - 1) * horizontalSpacing
|
||||||
|
|||||||
Reference in New Issue
Block a user