Here's the code being used to set the GridStyle of our Diagram:
if (!userMapPreferences.GridStyle.Equals("None")) { diagram.ShowGrid = true; diagram.AlignToGrid = userMapPreferences.SnapToGrid; diagram.GridColor = DecodeColor(userMapPreferences.GridLineColor); diagram.GridStyle = DecodeGridStyle(userMapPreferences.GridStyle); diagram.GridSizeX = userMapPreferences.HorizontalGridSpacing; diagram.GridSizeY = userMapPreferences.VerticalGridSpacing; }
public GridStyle DecodeGridStyle(string lineStyle) { switch (lineStyle.ToLower()) { case "points": return GridStyle.Points; case "lines": default: return GridStyle.Lines; } }
It works when the user has selected Lines, but if they select Points, no points appear on the Diagram canvas as expected.
Here's what the Canvas data-json looks like for the grid-related properties:
/* Lines (Works as expected - lines are displayed */ showGrid:true, gridStyle:1, gridColor:rgba(133,16,47,1), gridSizeX:100, gridSizeY:50, gridOffsetX:0, gridOffsetY:0, alignToGrid:true,
/* Points - Doesn't work as expected; no points are displayed */ showGrid:true, gridStyle:0, gridColor:rgba(133,16,47,1), gridSizeX:100, gridSizeY:50, gridOffsetX:0, gridOffsetY:0, alignToGrid:true,
Is there another setting that needs to be set somewhere else?
|