I am creating a drawing system using triangulation and I am currently getting rough edges, I have tried making them with UI corner with the radius of 1,0 so they are circle but that didn’t seem to do anything, border pixel is off.
Without UI corner(Normal):
https://gyazo.com/784e0fff56d4e55d5c4b418056c67634
UI Corner with radius of 1,0:
https://gyazo.com/4d002a4a95da944233a7987025e3917e
My drawing function:
function drawLine(pos1, pos2, studSize)
local frame = Instance.new("Frame")
local UICorner = Instance.new("UICorner")
local distanceInPixel = (pos2 - pos1).Magnitude
local deltaX = pos2.X - pos1.X
local deltaY = pos2.Y - pos1.Y
local angleBetween = math.atan2(deltaY, deltaX)
frame.BackgroundColor3 = selectedColor
UICorner.CornerRadius = UDim.new(1, 0)
UICorner.Parent = frame
frame.BorderSizePixel = 0
frame.Name = "DrawingPiece"
frame.AnchorPoint = Vector2.new(0.5, 0.5)
frame.Position = UDim2.new(0, (pos1.X + pos2.X)/2 - Canvas.AbsolutePosition.X, 0, (pos1.Y + pos2.Y)/2 - Canvas.AbsolutePosition.Y)
frame.Size = UDim2.new(0, distanceInPixel + 1,0, 5)
frame.Rotation = math.deg(angleBetween)
frame.Parent = Canvas
end
Any help will be amazing, thanks in advance.