File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
src/uiobjectutils/src/Client Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff 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
9292end
9393
9494return UICornerUtils
You can’t perform that action at this time.
0 commit comments