mouse caret movement

This commit is contained in:
MihailRis
2024-02-22 13:32:27 +03:00
parent c674bd4ec5
commit 90057e1f30
4 changed files with 31 additions and 11 deletions
+2 -2
View File
@@ -34,8 +34,8 @@ bool Font::isPrintableChar(int c) {
const int RES = 16;
int Font::calcWidth(std::wstring text) {
return text.length() * 8;
int Font::calcWidth(std::wstring text, size_t length) {
return std::min(text.length(), length) * 8;
}
void Font::draw(Batch2D* batch, std::wstring text, int x, int y) {
+1 -1
View File
@@ -23,7 +23,7 @@ public:
int getLineHeight() const;
int getYOffset() const;
int calcWidth(std::wstring text);
int calcWidth(std::wstring text, size_t length=-1);
// int getGlyphWidth(char c);
bool isPrintableChar(int c);
void draw(Batch2D* batch, std::wstring text, int x, int y);