Skip to content

Commit

Permalink
Merge pull request #25 from Likilee/master
Browse files Browse the repository at this point in the history
[minor_changed]Change object.scale in updateObject function to absolu…
  • Loading branch information
davidfig authored Oct 29, 2021
2 parents f9b1ea0 + 5ba5f14 commit d4e7a80
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions code/simple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@ export class Simple {
updateObject(object: DisplayObjectWithCulling) {
const box = object.getLocalBounds()
object.AABB = object.AABB || { x: 0, y: 0, width: 0, height: 0 }
object.AABB.x = object.x + (box.x - object.pivot.x) * object.scale.x
object.AABB.y = object.y + (box.y - object.pivot.y) * object.scale.y
object.AABB.width = box.width * object.scale.x
object.AABB.height = box.height * object.scale.y
object.AABB.x = object.x + (box.x - object.pivot.x) * Math.abs(object.scale.x)
object.AABB.y = object.y + (box.y - object.pivot.y) * Math.abs(object.scale.y)
object.AABB.width = box.width * Math.abs(object.scale.x)
object.AABB.height = box.height * Math.abs(object.scale.y)
}

/**
Expand Down

0 comments on commit d4e7a80

Please sign in to comment.