chore(小程序): 初始化工程仓库
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
import {test} from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
import {cellAtPoint} from '../src/core/canvas.ts'
|
||||
test('页面滚动和画布偏移后仍准确定位格子',()=>{
|
||||
assert.equal(cellAtPoint(125,345,{left:100,top:300,width:100,height:100},10,10),42)
|
||||
assert.equal(cellAtPoint(125,45,{left:100,top:0,width:100,height:100},10,10),42)
|
||||
assert.equal(cellAtPoint(125,-1,{left:100,top:0,width:100,height:100},10,10),null)
|
||||
})
|
||||
Reference in New Issue
Block a user