metauni / metaboard

Multiplayer drawing boards for sharing knowledge in Roblox.
Mozilla Public License 2.0
28 stars 6 forks source link

Mismatch between appearance of lines in canvas and in world #13

Closed dmurfet closed 2 years ago

dmurfet commented 2 years ago

In the canvas lines have rounded ends (via UICorners) but in the world they don't, and this is visible at large line widths and with sharp corners. We can consider adding extra parts to the world (e.g. Cylinders) to fix the mismatch.

Screen Shot 2021-12-24 at 7 45 07 am
blinkybool commented 2 years ago

You need to set the size of lines like they are done in CanvasState.UpdateLineFrame (account for thickness).

Rounding with cylinders on the end means you don't add the thickness to the line length because the cylinders add that extra half thickness on each end, rounding with uicorners means you do (the end of the line is at the perimeter of the rounded corner, not the radial centre).

If there's no rounding, you need to do the same thing as the uicorner method.

dmurfet commented 2 years ago

Are you saying that when drawing world lines using parts, lineInfo.Length * yStuds is not the correct value in Size.X for the part, or are you saying that if I wanted to add cylinders on the end then I would have to account for the length change as in CanvasState.UpdateLineFrame?

blinkybool commented 2 years ago

The opposite. If you don't have cylinders on the ends, then you need to make the lines longer to add the extra half thickness that the cylinders would add. This is fixed now in v0.3.2