smoothing out results from gui shaders

roundedRectangle and circle drawing now smooth out their results
This commit is contained in:
marauder2k7 2024-03-07 09:47:18 +00:00
parent 2dc623df7e
commit 0d448ad761
6 changed files with 57 additions and 52 deletions

View file

@ -271,19 +271,26 @@ void GuiShaderEditor::onRender(Point2I offset, const RectI& updateRect)
{
// for temp connetion, nodeA is always the first node selected.
Point2I start(Point2I::Zero);
ColorI color(ColorI::WHITE);
if (mTempConnection->inSocket != NULL)
{
start = mTempConnection->nodeA->localToGlobalCoord(mTempConnection->inSocket->pos) + offset;
else if(mTempConnection->outSocket != NULL)
color = mTempConnection->inSocket->col;
}
else if (mTempConnection->outSocket != NULL)
{
start = mTempConnection->nodeA->localToGlobalCoord(mTempConnection->outSocket->pos) + offset;
color = mTempConnection->outSocket->col;
}
RectI sockActive(start, Point2I(mNodeSize, mNodeSize));
start += Point2I(mNodeSize / 2, mNodeSize / 2);
drawer->drawThickLine(start, mLastMousePos + offset, ColorI(255, 255, 255, 255), (F32)mNodeSize / 3);
drawer->drawThickLine(start, mLastMousePos + offset, color, (F32)mNodeSize / 3);
// draw socket overlay over the top of the line.
sockActive.inset(1, 1);
drawer->drawCircleFill(sockActive, ColorI(255, 255, 255), mNodeSize / 2);
drawer->drawCircleFill(sockActive, color, mNodeSize / 2);
}
}
// Draw selection rectangle last so it is rendered on top.

View file

@ -73,22 +73,22 @@ struct NodeSocket
switch (inDim)
{
case DataDimensions::Dynamic:
col = ColorI(200, 200, 200, 200);
col = ColorI(200, 200, 200, 128);
break;
case DataDimensions::Scalar:
col = ColorI(210, 105, 30, 200);
col = ColorI(210, 105, 30, 128);
break;
case DataDimensions::Vector2:
col = ColorI(152, 251,152, 200);
col = ColorI(152, 251,152, 128);
break;
case DataDimensions::Vector3:
col = ColorI(127, 255, 212, 200);
col = ColorI(127, 255, 212, 128);
break;
case DataDimensions::Vector4:
col = ColorI(100, 149, 237, 200);
col = ColorI(100, 149, 237, 128);
break;
case DataDimensions::Mat4x4:
col = ColorI(153, 50, 204, 200);
col = ColorI(153, 50, 204, 128);
break;
default:
break;