Skip to content

Commit

Permalink
EllipseTool: fix to remove initial rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
dsizzle committed Oct 13, 2023
1 parent df31bf6 commit a675dac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions artpaint/tools/EllipseTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ EllipseTool::UseTool(ImageView* view, uint32 buttons, BPoint point, BPoint)

float new_angle, prev_angle;
if (GetCurrentValue(ROTATION_ENABLED_OPTION) == B_CONTROL_ON) {
BPoint centroid = new_rect.LeftTop() + new_rect.RightTop()
+ new_rect.RightBottom() + new_rect.LeftBottom();
BPoint centroid = bitmap_rect.LeftTop() + bitmap_rect.RightTop()
+ bitmap_rect.RightBottom() + bitmap_rect.LeftBottom();
centroid.x /= 4;
centroid.y /= 4;
prev_angle = new_angle = 0;
Expand Down Expand Up @@ -289,8 +289,8 @@ EllipseTool::UseTool(ImageView* view, uint32 buttons, BPoint point, BPoint)
view->getCoords(&point, &buttons, &view_point);
window->Unlock();
if (centroid.x != point.x) {
new_angle = atan((centroid.y - view_point.y)
/ (centroid.x - view_point.x)) * 180 / M_PI;
new_angle = atan((centroid.y - point.y)
/ (centroid.x - point.x)) * 180 / M_PI;
} else {
new_angle = 90;
}
Expand Down

0 comments on commit a675dac

Please sign in to comment.