对像素进行取整保证在不同分辨率下保持清晰

This commit is contained in:
yhh
2021-05-25 11:16:49 +08:00
parent da3ab02a8d
commit 6c44d38c10
8 changed files with 53 additions and 45 deletions

View File

@@ -16,7 +16,7 @@ module es {
*/
public update(amount: number){
this.remainder += amount;
let motion = Math.floor(Math.trunc(this.remainder));
let motion = Math.trunc(this.remainder);
this.remainder -= motion;
amount = motion;
return amount;