Skip to content

Commit

Permalink
idiot.. you only rounded when holding down shift!
Browse files Browse the repository at this point in the history
  • Loading branch information
MrStevns committed Aug 22, 2017
1 parent 0fc703f commit 72ed4e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/TransformUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ bool TransformUI::mouseDrag(MouseEvent evt)
mRotationAngle = i*PI_4;
vec3 rotBase = vec3(mViewToShape * vec4(mMouseDragStart, 0, 1));
for (int j = 0; j < 4; j++){
vec2 rotatePoints = rotatePoint(mPreRotShape[j], vec2(roundf(rotBase.x),roundf(rotBase.y)), mRotationAngle);
vec2 rotatePoints = rotatePoint(mPreRotShape[j], vec2(rotBase), mRotationAngle);
shape[j] = rotatePoints;
}
}
Expand Down Expand Up @@ -225,7 +225,7 @@ float TransformUI::getAngle(const vec2& v1, const vec2& v2)

vec2 TransformUI::rotatePoint(const vec2& point, const vec2& rotBase, float angleRadian)
{
vec2 v = point - rotBase;
vec2 v = point - vec2(roundf(rotBase.x),roundf(rotBase.y));
vec2 v_pxlP = vec2(static_cast<int>(v.x),static_cast<int>(v.y));
v_pxlP = rotate(v_pxlP, angleRadian);
return rotBase + v_pxlP;
Expand Down

0 comments on commit 72ed4e3

Please sign in to comment.