let .net do the rounding

This commit is contained in:
Lars Brubaker 2016-05-11 12:26:20 -07:00
parent 7f1255ace1
commit 5614563530
7 changed files with 16 additions and 16 deletions

View file

@ -95,10 +95,10 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
OriginRelativeParent = screenPosition;
// draw the line that is on the ground
double yGround = (int)(startLineGroundPos.y + .5) + .5;
double yGround = Math.Round(startLineGroundPos.y) + .5;
drawEvent.graphics2D.Line(startLineGroundPos.x, yGround, startLineGroundPos.x + HorizontalLineLength - 5, yGround, RGBA_Bytes.Black);
// and the line that is at the base of the selection
double ySelection = (int)(startLineSelectionPos.y + .5) + .5;
double ySelection = Math.Round(startLineSelectionPos.y) + .5;
drawEvent.graphics2D.Line(startLineSelectionPos.x, ySelection, startLineSelectionPos.x + HorizontalLineLength - 5, ySelection, RGBA_Bytes.Black);
// draw the vertical line that shows the measurement

View file

@ -136,7 +136,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
// snap the z position
double bottom = selectedBounds.minXYZ.z + delta.z;
double snappedBottom = ((int)((bottom / snapGridDistance) + .5)) * snapGridDistance;
double snappedBottom = (Math.Round((bottom / snapGridDistance))) * snapGridDistance;
delta.z = snappedBottom - selectedBounds.minXYZ.z;
}