Skip to content

Commit a0cf24f

Browse files
committed
fix: Return inside point for debugging too
1 parent 333a1a0 commit a0cf24f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/uiobjectutils/src/Client/UICornerUtils.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function UICornerUtils.clampPositionToFrame(
4747
frameSize: Vector2,
4848
radius: number,
4949
point: Vector2
50-
): (Vector2?, Vector2?)
50+
): (Vector2?, Vector2?, Vector2?)
5151
assert(radius >= 0, "Bad radius")
5252
assert(point, "Bad point")
5353

@@ -77,18 +77,18 @@ function UICornerUtils.clampPositionToFrame(
7777
rpy = miny
7878
end
7979

80-
local position = Vector2.new(rpx, rpy)
80+
local insidePosition = Vector2.new(rpx, rpy)
8181

8282
-- project in direction of offset
83-
local direction = point - position
83+
local direction = point - insidePosition
8484
if direction.Magnitude == 0 then
8585
-- Shouldn't happen!
86-
return nil, nil
86+
return nil, nil, nil
8787
end
8888

8989
local normal = direction.Unit
90-
local outsidePosition = position + normal * radius
91-
return outsidePosition, normal
90+
local outsidePosition = insidePosition + normal * radius
91+
return outsidePosition, normal, insidePosition
9292
end
9393

9494
return UICornerUtils

0 commit comments

Comments
 (0)