Skip to content

Commit

Permalink
Clean up absolute calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
yinanazhou committed May 14, 2024
1 parent 0c7623e commit 4e9ece8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/vrv/editortoolkit_neume.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ struct ClosestBB {
int offset = (x - ulx) * tan(rotate * M_PI / 180.0);
uly = uly + offset;
lry = lry + offset;
int xDiff = std::max((ulx > x ? ulx - x : 0), (x > lrx ? x - lrx : 0));
int yDiff = std::max((uly > y ? uly - y : 0), (y > lry ? y - lry : 0));
int xDiff = std::abs(x - ulx);
int yDiff = std::abs(y - uly);

return sqrt(xDiff * xDiff + yDiff * yDiff);
}
Expand All @@ -143,6 +143,7 @@ struct ClosestBB {
};

// To be used with std::stable_sort to find the position to insert a new accid / divLine
// TODO: use closesBB instead
struct ClosestNeume {
int x;
int y;
Expand Down

0 comments on commit 4e9ece8

Please sign in to comment.