Skip to content

Commit

Permalink
Update image_plugin.cpp
Browse files Browse the repository at this point in the history
Small formatting changes, make the degree symbol optional
  • Loading branch information
danthony06 authored Sep 6, 2024
1 parent 13875a7 commit 1f92426
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions mapviz_plugins/src/image_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,19 +222,19 @@ namespace mapviz_plugins
void ImagePlugin::SetRotation(QString rotation)
{

if (rotation == "90°")
if ((rotation == "90°") || (rotation == "90"))
{
rotation_ = cv::ROTATE_90_CLOCKWISE;
}
else if (rotation == "180°")
else if ((rotation == "180°") || (rotation == "180"))
{
rotation_ = cv::ROTATE_180;
}
else if (rotation == "270°")
else if ((rotation == "270°") || (rotation == "270"))
{
rotation_ = cv::ROTATE_90_COUNTERCLOCKWISE;
}
else{
else {
rotation_ = -1;
}
}
Expand Down Expand Up @@ -707,13 +707,10 @@ namespace mapviz_plugins
{
std::string rotation_string = "";

if (rotation == cv::ROTATE_90_CLOCKWISE)
rotation_string = "90°";
else if (rotation == cv::ROTATE_180)
rotation_string = "180°";
else if (rotation == cv::ROTATE_90_COUNTERCLOCKWISE)
rotation_string = "270°";

if (rotation == cv::ROTATE_90_CLOCKWISE) { rotation_string = "90°"; }
else if (rotation == cv::ROTATE_180) { rotation_string = "180°"; }
else if (rotation == cv::ROTATE_90_COUNTERCLOCKWISE) { rotation_string = "270°"; }

return rotation_string;
}

Expand Down

0 comments on commit 1f92426

Please sign in to comment.