Skip to content

Commit

Permalink
fix(game): 修复滚动方向,优化星球建筑页面
Browse files Browse the repository at this point in the history
  • Loading branch information
lovezhangchuangxin committed Dec 5, 2024
1 parent 18ae616 commit 65b0128
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/game/src/components/game-map/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ onMounted(() => {
y: pointerPos.y / oldScale - stage.y() / oldScale,
}
let newScale = e.deltaY > 0 ? oldScale * scaleBy : oldScale / scaleBy
let newScale = e.deltaY < 0 ? oldScale * scaleBy : oldScale / scaleBy
newScale = Math.min(10, Math.max(1, newScale))
stage.scale({ x: newScale, y: newScale })
Expand All @@ -76,7 +76,7 @@ onMounted(() => {
}
stage.position(newPos)
// 缩小才重新渲染,放大不用
if (e.deltaY < 0) {
if (e.deltaY > 0) {
render(stage, layer)
}
})
Expand Down
1 change: 1 addition & 0 deletions packages/game/src/views/planet/PlanetPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ const allResources = computed(() => {
})
onMounted(() => {
getMyData()
timerId.value = setInterval(() => {
getMyData()
}, 1000) as unknown as number
Expand Down

0 comments on commit 65b0128

Please sign in to comment.