mirror of
https://github.com/haven1433/HexManiacAdvance.git
synced 2026-10-01 20:56:36 -05:00
9-grid limit drawing range to drawing on map
This commit is contained in:
@@ -982,7 +982,11 @@ namespace HavenSoft.HexManiac.Core.ViewModels.Map {
|
||||
}
|
||||
|
||||
public void Draw9Grid(ModelDelta token, int[,] grid, double x, double y) {
|
||||
var layout = GetLayout();
|
||||
var (width, height) = (layout.GetValue("width"), layout.GetValue("height"));
|
||||
var (xx, yy) = ConvertCoordinates(x, y);
|
||||
xx = xx.LimitToRange(0, width - 1);
|
||||
yy = yy.LimitToRange(0, height - 1);
|
||||
Draw9Grid(token, grid, xx, yy);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user