Skip to content

Commit

Permalink
Implement pull request SebLague#103 from ChimeraReyat
Browse files Browse the repository at this point in the history
Bug fix for "Constant Point Size" not working if PathCreator object isn't at World Zero. SebLague#103
  • Loading branch information
JerryVerhoeven committed Sep 18, 2023
1 parent 6367936 commit d9c335a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Assets/PathCreator/Core/Editor/PathEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -409,10 +409,10 @@ void ProcessBezierPathInput(Event e)
mouseOverHandleIndex = -1;
for (int i = 0; i < bezierPath.NumPoints; i += 3)
{

int handleIndex = (previousMouseOverHandleIndex + i) % bezierPath.NumPoints;
float handleRadius = GetHandleDiameter(globalDisplaySettings.anchorSize * data.bezierHandleScale, bezierPath[handleIndex]) / 2f;
Vector3 pos = MathUtility.TransformPoint(bezierPath[handleIndex], creator.transform, bezierPath.Space);
int handleIndex = (previousMouseOverHandleIndex + i) % bezierPath.NumPoints;
Vector3 pos = MathUtility.TransformPoint(bezierPath[handleIndex], creator.transform, bezierPath.Space);
float handleRadius = GetHandleDiameter (globalDisplaySettings.anchorSize * data.bezierHandleScale, pos) / 2f;
float dst = HandleUtility.DistanceToCircle(pos, handleRadius);
if (dst == 0)
{
Expand Down Expand Up @@ -602,8 +602,8 @@ void DrawHandle(int i)
{
Vector3 handlePosition = MathUtility.TransformPoint(bezierPath[i], creator.transform, bezierPath.Space);

float anchorHandleSize = GetHandleDiameter(globalDisplaySettings.anchorSize * data.bezierHandleScale, bezierPath[i]);
float controlHandleSize = GetHandleDiameter(globalDisplaySettings.controlSize * data.bezierHandleScale, bezierPath[i]);
float anchorHandleSize = GetHandleDiameter (globalDisplaySettings.anchorSize * data.bezierHandleScale, handlePosition);
float controlHandleSize = GetHandleDiameter (globalDisplaySettings.controlSize * data.bezierHandleScale, handlePosition);

bool isAnchorPoint = i % 3 == 0;
bool isInteractive = isAnchorPoint || bezierPath.ControlPointMode != BezierPath.ControlMode.Automatic;
Expand Down

0 comments on commit d9c335a

Please sign in to comment.