[kandinsky] Add KDCodePoint prefix static code points

This commit is contained in:
Léa Saviot
2019-01-11 11:40:32 +01:00
committed by Émilie Feral
parent 50ac72107b
commit c31fe3856a
4 changed files with 10 additions and 10 deletions

View File

@@ -16,8 +16,8 @@ private:
uint32_t m_code;
};
static constexpr CodePoint Null = 0x0;
static constexpr CodePoint Tabulation = 0x9;
static constexpr CodePoint LineFeed = 0xA;
static constexpr CodePoint KDCodePointNull = 0x0;
static constexpr CodePoint KDCodePointTabulation = 0x9;
static constexpr CodePoint KDCodePointLineFeed = 0xA;
#endif

View File

@@ -14,11 +14,11 @@ KDPoint KDContext::drawString(const char * text, KDPoint p, const KDFont * font,
UTF8Decoder decoder(text);
CodePoint codePoint = decoder.nextCodePoint();
while (codePoint != Null) {
if (codePoint == LineFeed) {
while (codePoint != KDCodePointNull) {
if (codePoint == KDCodePointLineFeed) {
position = KDPoint(0, position.y() + glyphSize.height());
codePoint = decoder.nextCodePoint();
} else if (codePoint == Tabulation) {
} else if (codePoint == KDCodePointTabulation) {
position = position.translatedBy(KDPoint(k_tabCharacterWidth * glyphSize.width(), 0));
codePoint = decoder.nextCodePoint();
} else {

View File

@@ -13,12 +13,12 @@ KDSize KDFont::stringSize(const char * text) const {
UTF8Decoder decoder(text);
CodePoint codePoint = decoder.nextCodePoint();
while (codePoint != Null) {
while (codePoint != KDCodePointNull) {
KDSize cSize = KDSize(m_glyphSize.width(), 0);
if (codePoint == LineFeed) {
if (codePoint == KDCodePointLineFeed) {
cSize = KDSize(0, m_glyphSize.height());
codePoint = decoder.nextCodePoint();
} else if (codePoint == Tabulation) {
} else if (codePoint == KDCodePointTabulation) {
cSize = KDSize(k_tabCharacterWidth*m_glyphSize.width(), 0);
} else if (codePoint.isCombining()) {
cSize = KDSizeZero;