Skip to content

Commit

Permalink
Minor formatting tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
raysan5 committed Apr 20, 2024
1 parent 498511e commit 6f53233
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/raygui.h
Original file line number Diff line number Diff line change
Expand Up @@ -2991,9 +2991,9 @@ int GuiSliderPro(Rectangle bounds, const char *textLeft, const char *textRight,
if (*value > maxValue) *value = maxValue;
else if (*value < minValue) *value = minValue;
}

// Control value change check
if(oldValue == *value) result = 0;
if (oldValue == *value) result = 0;
else result = 1;

// Slider bar limits check
Expand Down Expand Up @@ -4829,7 +4829,7 @@ static void GuiDrawText(const char *text, Rectangle textBounds, int alignment, C
if (guiFont.glyphs[index].advanceX == 0) glyphWidth = ((float)guiFont.recs[index].width*scaleFactor);
else glyphWidth = (float)guiFont.glyphs[index].advanceX*scaleFactor;

// Wrap mode text measuring, to validate if
// Wrap mode text measuring, to validate if
// it can be drawn or a new line is required
if (wrapMode == TEXT_WRAP_CHAR)
{
Expand Down Expand Up @@ -4889,7 +4889,9 @@ static void GuiDrawText(const char *text, Rectangle textBounds, int alignment, C
else if (!overflowReached)
{
overflowReached = true;
for (int j = 0; j < ellipsisWidth; j += ellipsisWidth/3) {

for (int j = 0; j < ellipsisWidth; j += ellipsisWidth/3)
{
DrawTextCodepoint(guiFont, '.', RAYGUI_CLITERAL(Vector2){ textBoundsPosition.x + textOffsetX + j, textBoundsPosition.y + textOffsetY }, (float)GuiGetStyle(DEFAULT, TEXT_SIZE), GuiFade(tint, guiAlpha));
}
}
Expand Down Expand Up @@ -5506,21 +5508,21 @@ static int GetCodepointNext(const char *text, int *codepointSize)
if (0xf0 == (0xf8 & ptr[0]))
{
// 4 byte UTF-8 codepoint
if(((ptr[1] & 0xC0) ^ 0x80) || ((ptr[2] & 0xC0) ^ 0x80) || ((ptr[3] & 0xC0) ^ 0x80)) { return codepoint; } //10xxxxxx checks
if (((ptr[1] & 0xC0) ^ 0x80) || ((ptr[2] & 0xC0) ^ 0x80) || ((ptr[3] & 0xC0) ^ 0x80)) { return codepoint; } //10xxxxxx checks
codepoint = ((0x07 & ptr[0]) << 18) | ((0x3f & ptr[1]) << 12) | ((0x3f & ptr[2]) << 6) | (0x3f & ptr[3]);
*codepointSize = 4;
}
else if (0xe0 == (0xf0 & ptr[0]))
{
// 3 byte UTF-8 codepoint */
if(((ptr[1] & 0xC0) ^ 0x80) || ((ptr[2] & 0xC0) ^ 0x80)) { return codepoint; } //10xxxxxx checks
if (((ptr[1] & 0xC0) ^ 0x80) || ((ptr[2] & 0xC0) ^ 0x80)) { return codepoint; } //10xxxxxx checks
codepoint = ((0x0f & ptr[0]) << 12) | ((0x3f & ptr[1]) << 6) | (0x3f & ptr[2]);
*codepointSize = 3;
}
else if (0xc0 == (0xe0 & ptr[0]))
{
// 2 byte UTF-8 codepoint
if((ptr[1] & 0xC0) ^ 0x80) { return codepoint; } //10xxxxxx checks
if ((ptr[1] & 0xC0) ^ 0x80) { return codepoint; } //10xxxxxx checks
codepoint = ((0x1f & ptr[0]) << 6) | (0x3f & ptr[1]);
*codepointSize = 2;
}
Expand Down

0 comments on commit 6f53233

Please sign in to comment.