mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[escher/src/text_area] Add char limit in text_area line
Change-Id: I9284936f0202d788edc785aa3f7c82b45ab34cf5
This commit is contained in:
committed by
Émilie Feral
parent
51002066e9
commit
b92c819ea2
@@ -28,6 +28,7 @@ KDPoint KDContext::pushOrPullString(const char * text, KDPoint p, const KDFont *
|
||||
while (codePoint != UCodePointNull && (maxByteLength < 0 || codePointPointer < text + maxByteLength)) {
|
||||
codePointPointer = decoder.stringPosition();
|
||||
if (codePoint == UCodePointLineFeed) {
|
||||
assert(position.y() < KDCOORDINATE_MAX - glyphSize.height());
|
||||
position = KDPoint(0, position.y() + glyphSize.height());
|
||||
codePoint = decoder.nextCodePoint();
|
||||
} else if (codePoint == UCodePointTabulation) {
|
||||
|
||||
@@ -30,6 +30,7 @@ KDSize KDFont::stringSizeUntil(const char * text, const char * limit) const {
|
||||
currentStringPosition = decoder.stringPosition();
|
||||
codePoint = decoder.nextCodePoint();
|
||||
}
|
||||
assert(stringSize.width() >= 0 && stringSize.height() >= 0);
|
||||
return stringSize;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
#include <kandinsky/point.h>
|
||||
#include <assert.h>
|
||||
|
||||
KDPoint KDPoint::translatedBy(KDPoint other) const {
|
||||
assert((other.x() >= 0 && m_x <= KDCOORDINATE_MAX - other.x()) || (other.x() < 0 && m_x >= KDCOORDINATE_MIN - other.x()));
|
||||
assert((other.y() >= 0 && m_y <= KDCOORDINATE_MAX - other.y()) || (other.y() < 0 && m_y >= KDCOORDINATE_MIN - other.y()));
|
||||
|
||||
return KDPoint(m_x+other.x(), m_y+other.y());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user