Skip to content

Commit

Permalink
[CLT] fix(sprite): check vector for zero before rotating
Browse files Browse the repository at this point in the history
  • Loading branch information
Insineer committed Oct 8, 2019
1 parent 7ad462a commit ce14549
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions SharedLibrary/Sources/Shared/Geometry/Vec2.inl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ vec2<double> vec2<T>::unit() const {

template <typename T>
vec2<double> vec2<T>::rotate(Angle angle) const {
if (isZero())
return {};
return vec2<double>::unit(angle + this->angle()) * magnitude();
}

Expand Down

0 comments on commit ce14549

Please sign in to comment.