private void  ShowPointControls(Ferr2DPath aPath, int i, PathEditorUtil.Selection aSelection, Matrix4x4 aTransform, SerializedProperty aPathProp)
    {
        EventType eType = Event.current.type;

        Ferr2D_PointData pointData        = aPath.GetData(i);
        Vector2          point            = aPath[i];
        Vector2          pointNormal      = aPath.GetNormal(i);
        Vector3          pointWorld       = aTransform.MultiplyPoint(point);
        Vector3          pointWorldNormal = aTransform.MultiplyVector(pointNormal);
        float            pointSize        = eType == EventType.Layout || eType == EventType.Repaint ? HandleUtility.GetHandleSize(pointWorld) : 0;

        // point scale button
        if (terrain.EdgeMode != Ferr2D_SectionMode.None && (i == activePoint || aSelection.IsSelected(i) || pointData.scale != 1))
        {
            Vector3 scaleStart = pointWorld + pointWorldNormal * (visuals.sizeVertex + sizeSmallHandle) * pointSize;
            Vector3 scalePos   = scaleStart + ((pointData.scale - 0.5f) * 3f) * pointWorldNormal;
            if (Event.current.alt)
            {
                // reset scale
                if (pointData.scale != 1 && Handles.Button(scalePos, Quaternion.identity, pointSize * sizeSmallHandle, pointSize * sizeSmallHandle, Ferr2DT_Caps.CapDotReset))
                {
                    aSelection.Each(i, id => {
                        SerializedProperty scaleProp = aPathProp.FindPropertyRelative("_data").GetArrayElementAtIndex(id).FindPropertyRelative("scale");
                        scaleProp.floatValue         = 1;
                    });
                }
            }
            else
            {
                Vector2 screenNormal = HandleUtility.WorldToGUIPoint(pointWorld + pointWorldNormal) - HandleUtility.WorldToGUIPoint(pointWorld);
                screenNormal.Normalize();

                Vector3 move = Handles.FreeMoveHandle(scalePos, Quaternion.identity, pointSize * sizeSmallHandle, Vector3.zero, Ferr2DT_Caps.GetScaleCap(screenNormal));
                if (move != scalePos)
                {
                    move = PathUtil.GetClosetPointOnLine(scaleStart, scaleStart + pointWorldNormal * 3, move, true);
                    float finalScale = 0.5f + (scaleStart - move).magnitude / 3f;
                    float delta      = finalScale - pointData.scale;

                    aSelection.Each(i, id => {
                        SerializedProperty scaleProp = aPathProp.FindPropertyRelative("_data").GetArrayElementAtIndex(id).FindPropertyRelative("scale");
                        scaleProp.floatValue        += delta;
                    });
                }
            }
        }

        // show index numbers
        if (Ferr2DT_SceneOverlay.showIndices)
        {
            Vector2 pt = HandleUtility.WorldToGUIPoint(pointWorld - pointWorldNormal * pointSize * sizeLargeHandle * 2);
            Rect    r  = new Rect(pt.x - 15, pt.y - EditorGUIUtility.singleLineHeight * 0.5f, 30, EditorGUIUtility.singleLineHeight);
            Handles.BeginGUI();
            GUI.Label(r, i.ToString(), PathEditorUtil.CenteredShadowStyle);
            GUI.Label(r, i.ToString(), PathEditorUtil.CenteredLabelStyle);
            Handles.EndGUI();
        }
    }