Skip to content

Commit

Permalink
Merge pull request ikemen-engine#1731 from Eiton/Camera-Fix
Browse files Browse the repository at this point in the history
fix: incorrect horizontal camera bound
  • Loading branch information
K4thos committed Apr 11, 2024
2 parents cd72bb4 + b0591d8 commit debee0c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/camera.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,8 @@ func (c *Camera) action(x, y, scale float32, pause bool) (newX, newY, newScale f
newY = MinF(MaxF(newY, float32(c.boundhigh)*c.localscl*newScale), float32(c.boundlow)*c.localscl*newScale)
} else {
newScale = MinF(MaxF(newScale, c.zoomout), c.zoomin)
newX = MinF(MaxF(newX, float32(c.boundleft)*c.localscl*newScale), float32(c.boundright)*c.localscl*newScale)
newY = MinF(MaxF(newY, float32(c.boundhigh)*c.localscl*newScale), float32(c.boundlow)*c.localscl*newScale)
newX = MinF(MaxF(newX, c.minLeft+c.halfWidth/newScale, c.maxRight-c.halfWidth/newScale))
newY = MinF(MaxF(newY, float32(c.boundhigh)*c.localscl), float32(c.boundlow)*c.localscl)
}

case Follow_View:
Expand Down

0 comments on commit debee0c

Please sign in to comment.