Skip to content

Commit

Permalink
Zoom時にカメラによる画面端を考慮した処理が無かったのを修正
Browse files Browse the repository at this point in the history
Zoom時にカメラによる画面端を考慮した処理が無かったのを修正
  • Loading branch information
NeatUnsou committed Jan 11, 2023
1 parent 381114f commit fcdc168
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@ func (s *System) action() {
s.drawc2mtk = s.drawc2mtk[:0]
s.drawwh = s.drawwh[:0]
s.clsnText = nil
var x, y, scl float32 = s.cam.Pos[0], s.cam.Pos[1], s.cam.Scale/s.cam.BaseScale()
var x, y, scl float32 = s.cam.Pos[0], s.cam.Pos[1], s.cam.Scale / s.cam.BaseScale()
var cvmin, cvmax, highest, lowest, leftest, rightest float32 = 0, 0, 0, 0, 0, 0
leftest, rightest = x, x
if s.cam.ytensionenable {
Expand Down Expand Up @@ -2033,12 +2033,12 @@ func (s *System) fight() (reload bool) {
}
if s.zoomCameraBound {
dscl = MaxF(s.cam.MinScale, s.drawScale/s.cam.BaseScale())
dx = s.cam.XBound(dscl, x+s.zoomPosXLag/scl)
dx = s.cam.XBound(dscl, x+ClampF(s.zoomPosXLag/scl, -s.cam.halfWidth/scl*2*(1-1/s.zoomScale), s.cam.halfWidth/scl*2*(1-1/s.zoomScale)))
} else {
dscl = s.drawScale / s.cam.BaseScale()
dx = x + s.zoomPosXLag/scl
}
dy = y + s.zoomPosYLag
dy = y + s.zoomPosYLag/scl
} else {
s.zoomlag = 0
s.zoomPosXLag = 0
Expand Down

0 comments on commit fcdc168

Please sign in to comment.