mouse caret movement
This commit is contained in:
@@ -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
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user