Draw the line (oder so)

This commit is contained in:
2026-09-05 14:46:51 +02:00
parent 245cc0f314
commit 6a22b26a3d
2 changed files with 9 additions and 0 deletions
+2
View File
@@ -98,6 +98,8 @@ class PD_API Drawlist {
void DrawText(const fvec2& p, const char* text, const PD::Color& color); void DrawText(const fvec2& p, const char* text, const PD::Color& color);
void DrawTextEx(const fvec2& p, const char* text, const PD::Color& color, void DrawTextEx(const fvec2& p, const char* text, const PD::Color& color,
LiTextFlags flags, const fvec2& box = fvec2(0.f)); LiTextFlags flags, const fvec2& box = fvec2(0.f));
void DrawLine(const fvec2& a, const fvec2& b, const PD::Color& color,
int thickness = 1);
void DrawPolyLine(const Pool<fvec2>& points, const PD::Color& color, void DrawPolyLine(const Pool<fvec2>& points, const PD::Color& color,
LiDrawFlags flags = LiDrawFlags_None, int t = 1); LiDrawFlags flags = LiDrawFlags_None, int t = 1);
+7
View File
@@ -232,6 +232,13 @@ PD_API void Drawlist::DrawTextEx(const fvec2& p, const char* text,
pFont->CmdTextEx(*this, p, color, pFontScale, text, flags, box); pFont->CmdTextEx(*this, p, color, pFontScale, text, flags, box);
} }
PD_API void Drawlist::DrawLine(const fvec2& a, const fvec2& b,
const PD::Color& color, int thickness) {
this->PathAdd(a);
this->PathAdd(b);
this->PathStroke(color, thickness);
}
PD_API void Drawlist::DrawPolyLine(const Pool<fvec2>& points, PD_API void Drawlist::DrawPolyLine(const Pool<fvec2>& points,
const PD::Color& color, LiDrawFlags flags, const PD::Color& color, LiDrawFlags flags,
int t) { int t) {