Fix whitespace

This commit is contained in:
jlewin 2019-05-13 13:03:50 -07:00
parent 209826d504
commit 1f5bdfcf3b

View file

@ -72,7 +72,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
/// <returns></returns> /// <returns></returns>
internal int Tile(int faceSharingEdge) internal int Tile(int faceSharingEdge)
{ {
if(faceSharingEdge == left) if (faceSharingEdge == left)
{ {
return 3; return 3;
} }
@ -102,7 +102,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
{ {
if (faceCornerA == left) if (faceCornerA == left)
{ {
if(faceCornerB == top) if (faceCornerB == top)
{ {
return 6; return 6;
} }
@ -113,7 +113,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
} }
else if (faceCornerA == bottom) else if (faceCornerA == bottom)
{ {
if(faceCornerB == left) if (faceCornerB == left)
{ {
return 0; return 0;
} }
@ -162,6 +162,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
private WorldView world; private WorldView world;
private ThemeConfig theme; private ThemeConfig theme;
private List<ConnectedFaces> connections = new List<ConnectedFaces>(); private List<ConnectedFaces> connections = new List<ConnectedFaces>();
private HitData lastHitData = new HitData();
public TumbleCubeControl(InteractionLayer interactionLayer, ThemeConfig theme) public TumbleCubeControl(InteractionLayer interactionLayer, ThemeConfig theme)
: base(100 * GuiWidget.DeviceScale, 100 * GuiWidget.DeviceScale) : base(100 * GuiWidget.DeviceScale, 100 * GuiWidget.DeviceScale)
@ -268,7 +269,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
} }
} }
HitData lastHitData = new HitData();
private void DrawMouseHover(HitData hitData) private void DrawMouseHover(HitData hitData)
{ {
if (!lastHitData.Equals(hitData)) if (!lastHitData.Equals(hitData))
@ -372,7 +372,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
{ {
base.OnMouseUp(mouseEvent); base.OnMouseUp(mouseEvent);
if(mouseEvent.Button != MouseButtons.Left) if (mouseEvent.Button != MouseButtons.Left)
{ {
return; return;
} }
@ -400,6 +400,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
double duration = .25; double duration = .25;
var timer = Stopwatch.StartNew(); var timer = Stopwatch.StartNew();
var time = timer.Elapsed.TotalSeconds; var time = timer.Elapsed.TotalSeconds;
while (time < duration) while (time < duration)
{ {
var current = Quaternion.Slerp(start, end, time / duration); var current = Quaternion.Slerp(start, end, time / duration);
@ -411,6 +412,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
time = timer.Elapsed.TotalSeconds; time = timer.Elapsed.TotalSeconds;
Thread.Sleep(10); Thread.Sleep(10);
} }
interactionLayer.World.RotationMatrix = Matrix4X4.CreateRotation(end); interactionLayer.World.RotationMatrix = Matrix4X4.CreateRotation(end);
Invalidate(); Invalidate();
}); });
@ -425,6 +427,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
var up = Vector3.Zero; var up = Vector3.Zero;
var normal = Vector3.Zero; var normal = Vector3.Zero;
var count = 0; var count = 0;
for (int i = 0; i < 3; i++) for (int i = 0; i < 3; i++)
{ {
count++; count++;
@ -502,13 +505,13 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
private HitData GetHitData(Vector3 hitPosition) private HitData GetHitData(Vector3 hitPosition)
{ {
for(int i=0; i<6; i++) for (int i = 0; i < 6; i++)
{ {
var faceData = connections[i]; var faceData = connections[i];
if (Math.Abs(hitPosition[faceData.axis] - faceData.direction * 2) < .0001) if (Math.Abs(hitPosition[faceData.axis] - faceData.direction * 2) < .0001)
{ {
// hit to the left // hit to the left
if (hitPosition[connections[faceData.left].axis] if (hitPosition[connections[faceData.left].axis]
* connections[faceData.left].direction * connections[faceData.left].direction
> 1) > 1)
{ {
@ -578,7 +581,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
return new HitData(i, 4); return new HitData(i, 4);
} }
} }
return new HitData(0, 4); return new HitData(0, 4);
} }
@ -645,7 +648,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
{ {
} }
public HitData(int faceIndex0, int tileIndex0, public HitData(int faceIndex0, int tileIndex0,
int faceIndex1 = -1, int tileIndex1 = -1, int faceIndex1 = -1, int tileIndex1 = -1,
int faceIndex2 = -1, int tileIndex2 = -1) int faceIndex2 = -1, int tileIndex2 = -1)
{ {
@ -661,9 +664,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
{ {
if (obj is HitData hitData) if (obj is HitData hitData)
{ {
for(int i=0; i < 3; i++) for (int i = 0; i < 3; i++)
{ {
if(FaceIndex[i] != hitData.FaceIndex[i] if (FaceIndex[i] != hitData.FaceIndex[i]
|| TileIndex != hitData.TileIndex) || TileIndex != hitData.TileIndex)
{ {
return false; return false;