Add default parameters to Text and TextEx

This commit is contained in:
Robert Müller 2023-04-12 22:36:52 +02:00
parent f0c295b2d3
commit a160364b77
2 changed files with 4 additions and 4 deletions

View file

@ -823,7 +823,7 @@ public:
pCursor->m_Y = y;
}
void Text(float x, float y, float Size, const char *pText, float LineWidth) override
void Text(float x, float y, float Size, const char *pText, float LineWidth = -1.0f) override
{
CTextCursor Cursor;
SetCursor(&Cursor, x, y, Size, TEXTFLAG_RENDER);
@ -918,7 +918,7 @@ public:
return m_SelectionColor;
}
void TextEx(CTextCursor *pCursor, const char *pText, int Length) override
void TextEx(CTextCursor *pCursor, const char *pText, int Length = -1) override
{
const unsigned OldRenderFlags = m_RenderFlags;
m_RenderFlags |= TEXT_RENDER_FLAG_ONE_TIME_USE;

View file

@ -229,7 +229,7 @@ public:
ColorRGBA DefaultSelectionColor() const { return ColorRGBA(0, 0, 1.0f, 1.0f); }
//
virtual void TextEx(CTextCursor *pCursor, const char *pText, int Length) = 0;
virtual void TextEx(CTextCursor *pCursor, const char *pText, int Length = -1) = 0;
virtual bool CreateTextContainer(int &TextContainerIndex, CTextCursor *pCursor, const char *pText, int Length = -1) = 0;
virtual void AppendTextContainer(int TextContainerIndex, CTextCursor *pCursor, const char *pText, int Length = -1) = 0;
// either creates a new text container or appends to a existing one
@ -262,7 +262,7 @@ public:
virtual void TextOutlineColor(ColorRGBA rgb) = 0;
virtual void TextSelectionColor(float r, float g, float b, float a) = 0;
virtual void TextSelectionColor(ColorRGBA rgb) = 0;
virtual void Text(float x, float y, float Size, const char *pText, float LineWidth) = 0;
virtual void Text(float x, float y, float Size, const char *pText, float LineWidth = -1.0f) = 0;
virtual float TextWidth(float Size, const char *pText, int StrLength = -1, float LineWidth = -1.0f, int Flags = 0, float *pHeight = nullptr, float *pAlignedFontSize = nullptr, float *pMaxCharacterHeightInLine = nullptr) = 0;
virtual STextBoundingBox TextBoundingBox(float Size, const char *pText, int StrLength = -1, float LineWidth = -1.0f, int Flags = 0) = 0;
virtual vec2 CaretPosition(float Size, const char *pText, int StrLength = -1, float LineWidth = -1.0f, int Flags = 0) = 0;