mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[escher] TextArea: fix drawStringAt action with negative length
This commit is contained in:
@@ -106,7 +106,7 @@ protected:
|
||||
m_cursorLocation = m_text.text();
|
||||
}
|
||||
void drawRect(KDContext * ctx, KDRect rect) const override;
|
||||
void drawStringAt(KDContext * ctx, int line, int column, const char * text, size_t length, KDColor textColor, KDColor backgroundColor, const char * selectionStart, const char * selectionEnd, KDColor backgroundHighlightColor) const;
|
||||
void drawStringAt(KDContext * ctx, int line, int column, const char * text, int length, KDColor textColor, KDColor backgroundColor, const char * selectionStart, const char * selectionEnd, KDColor backgroundHighlightColor) const;
|
||||
virtual void drawLine(KDContext * ctx, int line, const char * text, size_t length, int fromColumn, int toColumn, const char * selectionStart, const char * selectionEnd) const = 0;
|
||||
virtual void clearRect(KDContext * ctx, KDRect rect) const = 0;
|
||||
KDSize minimalSizeForOptimalDisplay() const override;
|
||||
|
||||
@@ -407,7 +407,10 @@ void TextArea::ContentView::drawRect(KDContext * ctx, KDRect rect) const {
|
||||
}
|
||||
}
|
||||
|
||||
void TextArea::ContentView::drawStringAt(KDContext * ctx, int line, int column, const char * text, size_t length, KDColor textColor, KDColor backgroundColor, const char * selectionStart, const char * selectionEnd, KDColor backgroundHighlightColor) const {
|
||||
void TextArea::ContentView::drawStringAt(KDContext * ctx, int line, int column, const char * text, int length, KDColor textColor, KDColor backgroundColor, const char * selectionStart, const char * selectionEnd, KDColor backgroundHighlightColor) const {
|
||||
if (length < 0) {
|
||||
return;
|
||||
}
|
||||
KDSize glyphSize = m_font->glyphSize();
|
||||
|
||||
bool drawSelection = selectionStart != nullptr && selectionEnd > text && selectionStart < text + length;
|
||||
|
||||
Reference in New Issue
Block a user