-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
version: 6.1.2
DrawLineは「線を描画します」(DrawLine() | Interface IGraphics | GameCanvas)という基本的な関数ですが、線分を描画するのみで「直線」を描画することができません。
ソースコードを確認すると、線分を弾いているようです。
// todo: 直線の描画と書くのであれば、少なくともドキュメントにDrawLineは線分しか書けないことを明記すること、および単にImplementErrorを出すのではなく、たとえば、NotImplementedException("The line must be line segment.")と書くべきです。
| if (!line.IsSegment()) |
public void DrawLine(in GcLine line)
{
if (!m_IsInit || line.IsZero()) return;
if (!line.IsSegment())
{
// todo: 直線の描画
throw new System.NotImplementedException();
}
var s = new float2(line.Length, line.Length);
var mtx = GcAffine.FromTRS(line.Origin, line.Radian(), s).Mul(m_CurrentMatrix);
var mesh = m_MeshPool.GetOrCreate();
var lineWidth = math.max(m_CurrentStyle.LineWidth, m_PixelSizeMin);
if (TrySetupMeshAsLine(mesh, m_CurrentStyle.LineCap, lineWidth, mtx))
{
DrawMeshDirect(mesh, m_CurrentStyle.Color);
}
}Metadata
Metadata
Assignees
Labels
No labels