Skip to content

Commit dbf0113

Browse files
committed
Fix missing break
1 parent ca73585 commit dbf0113

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

CelestiaComponent/CelestiaSimulation.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// of the License, or (at your option) any later version.
99

1010
#include "pch.h"
11+
#include <celcompat/numbers.h>
1112
#include <celmath/geomutil.h>
1213
#include "CelestiaHelper.h"
1314
#include "CelestiaSimulation.h"
@@ -102,7 +103,7 @@ namespace winrt::CelestiaComponent::implementation
102103
Selection(loc->selection);
103104
sim->geosynchronousFollow();
104105
double radius = sel->Radius();
105-
double distance = radius * 5;
106+
double distance = radius * 5.0;
106107

107108
if (loc->distance && loc->unit)
108109
{
@@ -111,17 +112,21 @@ namespace winrt::CelestiaComponent::implementation
111112
{
112113
case CelestiaComponent::CelestiaGotoLocationDistanceUnit::KM:
113114
distance = distanceValue;
115+
break;
114116
case CelestiaComponent::CelestiaGotoLocationDistanceUnit::AU:
115117
distance = celestia::astro::AUtoKilometers(distanceValue);
118+
break;
116119
case CelestiaComponent::CelestiaGotoLocationDistanceUnit::Radii:
120+
default:
117121
distance = radius * distanceValue;
122+
break;
118123
}
119124
}
120125

121126
Eigen::Vector3f up(0.0f, 1.0f, 0.0f);
122127
if (loc->longitude && loc->latitude)
123128
{
124-
sim->gotoSelectionLongLat(5, distance, loc->longitude.Value() * (float)M_PI / 180.0f, loc->latitude.Value() * (float)M_PI / 180.0f, up);
129+
sim->gotoSelectionLongLat(5.0, distance, loc->longitude.Value() * static_cast<float>(celestia::numbers::pi) / 180.0f, loc->latitude.Value() * static_cast<float>(celestia::numbers::pi) / 180.0f, up);
125130
}
126131
else
127132
{

0 commit comments

Comments
 (0)