提交 f6246747 编写于 作者: 雪洛's avatar 雪洛

feat: 调整toInt为Math.floor

上级 c7b88b89
......@@ -159,7 +159,7 @@
}, 16)
}
if (k.toInt() != 0) {
if (Math.floor(k) != 0) {
cardTo(k * screenWidth * 1.3, this.y * 3, () => {
// 状态图标变回透明
this.setElementStyle("state-icon-like", 'opacity', 0)
......@@ -178,7 +178,7 @@
} else {
const _x : number = this.x
const _y : number = this.y
cardTo((_x * -0.05).toInt(), (_y * -0.05).toInt(), () => {
cardTo(Math.floor(_x * -0.05), Math.floor(_y * -0.05), () => {
cardTo(0, 0, () => {
console.log('bounce')
floating = false
......
......@@ -148,7 +148,7 @@
// 计算当前索引并重置差异
const current_offset_x = offset_x % this.$swiperWidth
const current_offset_i = offset_x / this.$swiperWidth
const current_index = this.$animationFinishIndex + current_offset_i.toInt()
const current_index = this.$animationFinishIndex + Math.floor(current_offset_i)
// 计算目标索引及边界检查
let move_to_index = current_index
......
......@@ -151,7 +151,7 @@
// 计算当前索引并重置差异
const current_offset_x = offset_x % this.$swiperWidth
const current_offset_i = offset_x / this.$swiperWidth
const current_index = this.$animationFinishIndex + current_offset_i.toInt()
const current_index = this.$animationFinishIndex + Math.floor(current_offset_i)
// 计算目标索引及边界检查
let move_to_index = current_index
......
......@@ -89,7 +89,7 @@
// 计算当前索引并重置差异
const current_offset_x = offset_x % this.$swiperWidth
const current_offset_i = offset_x / this.$swiperWidth
const current_index = this.$animationFinishIndex + current_offset_i.toInt()
const current_index = this.$animationFinishIndex + Math.floor(current_offset_i)
// 计算目标索引及边界检查
let move_to_index = current_index
......
......@@ -67,7 +67,7 @@
// 计算当前索引并重置差异
const current_offset_x = offset_x % this.$swiperWidth
const current_offset_i = offset_x / this.$swiperWidth
const current_index = this.$animationFinishIndex + current_offset_i.toInt()
const current_index = this.$animationFinishIndex + Math.floor(current_offset_i)
// 计算目标索引及边界检查
let move_to_index = current_index
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册