diagnostic tool fixes
This commit is contained in:
@ -13,7 +13,7 @@ type ViewPort struct {
|
||||
|
||||
func NewViewPort(x, y, w, h int) *ViewPort {
|
||||
vp := ViewPort{
|
||||
Rect: types.Rect{x, y, w, h},
|
||||
Rect: types.Rect{X: x, Y: y, W: w, H: h},
|
||||
}
|
||||
return &vp
|
||||
}
|
||||
@ -47,8 +47,8 @@ func (vp *ViewPort) ToVPCoords(c types.Coords) (newCoords types.Coords, err erro
|
||||
//coords on map to coords on vp
|
||||
x, y := c.X-vp.CameraCoords.X, c.Y-vp.CameraCoords.Y
|
||||
if x < 0 || y < 0 || x > vp.W || y > vp.H {
|
||||
return types.Coords{-1, -1}, fmt.Errorf("Not in viewport: {%d, %d}", x, y)
|
||||
return types.Coords{X: -1, Y: -1}, fmt.Errorf("Not in viewport: {%d, %d}", x, y)
|
||||
}
|
||||
return types.Coords{x, y}, nil
|
||||
return types.Coords{X: x, Y: y}, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user