Simplify bounds clipping a tiny bit
This commit is contained in:
@@ -1,10 +1,6 @@
|
||||
package scenario
|
||||
|
||||
import (
|
||||
// "image"
|
||||
|
||||
"github.com/hajimehoshi/ebiten"
|
||||
|
||||
"code.ur.gs/lupine/ordoor/internal/maps"
|
||||
)
|
||||
|
||||
@@ -14,12 +10,6 @@ type CellPoint struct {
|
||||
}
|
||||
|
||||
func (s *Scenario) CellAtCursor() (maps.Cell, CellPoint) {
|
||||
x, y := ebiten.CursorPosition()
|
||||
screenPos := CartPt{X: float64(s.Viewpoint.X + x), Y: float64(s.Viewpoint.Y + y)}
|
||||
isoPos := screenPos.ToISO()
|
||||
// Convert to cell coordinates.
|
||||
// TODO: zoom support will need a camera
|
||||
// FIXME: adjust for Z level
|
||||
|
||||
return s.area.Cell(int(isoPos.X), int(isoPos.Y), 0), CellPoint{IsoPt: isoPos, Z: s.ZIdx}
|
||||
cell := s.area.Cell(int(s.selectedCell.X), int(s.selectedCell.Y), 0)
|
||||
return cell, CellPoint{IsoPt: s.selectedCell, Z: 0}
|
||||
}
|
||||
|
Reference in New Issue
Block a user