mirror of
https://github.com/raysan5/raygui.git
synced 2026-01-29 10:19:18 -05:00
some tweaks
This commit is contained in:
12
src/raygui.h
12
src/raygui.h
@ -862,8 +862,8 @@ RAYGUIDEF int GuiComboBox(Rectangle bounds, int comboNum, char **comboText, int
|
|||||||
{
|
{
|
||||||
if (i == comboActive)
|
if (i == comboActive)
|
||||||
{
|
{
|
||||||
// Update control
|
// Update control
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
int textWidth = MeasureText(comboText[i], style[GLOBAL_TEXT_FONTSIZE]);
|
int textWidth = MeasureText(comboText[i], style[GLOBAL_TEXT_FONTSIZE]);
|
||||||
|
|
||||||
if (bounds.width < textWidth) bounds.width = textWidth + style[TOGGLE_TEXT_PADDING];
|
if (bounds.width < textWidth) bounds.width = textWidth + style[TOGGLE_TEXT_PADDING];
|
||||||
@ -875,7 +875,7 @@ RAYGUIDEF int GuiComboBox(Rectangle bounds, int comboNum, char **comboText, int
|
|||||||
else if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) state = ACTIVE;
|
else if (IsMouseButtonReleased(MOUSE_LEFT_BUTTON)) state = ACTIVE;
|
||||||
else state = FOCUS;
|
else state = FOCUS;
|
||||||
}
|
}
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
|
||||||
// Draw control
|
// Draw control
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
@ -929,8 +929,8 @@ RAYGUIDEF int GuiComboBox(Rectangle bounds, int comboNum, char **comboText, int
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CheckCollisionPointRec(GetMousePosition(), bounds) ||
|
if (CheckCollisionPointRec(mousePoint, bounds) ||
|
||||||
CheckCollisionPointRec(GetMousePosition(), click))
|
CheckCollisionPointRec(mousePoint, click))
|
||||||
{
|
{
|
||||||
if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON))
|
if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON))
|
||||||
{
|
{
|
||||||
@ -1383,7 +1383,7 @@ RAYGUIDEF char *GuiTextBox(Rectangle bounds, char *text)
|
|||||||
{
|
{
|
||||||
static int framesCounter = 0;
|
static int framesCounter = 0;
|
||||||
|
|
||||||
#define MAX_CHARS_LENGTH 20
|
#define MAX_CHARS_LENGTH 20
|
||||||
#define KEY_BACKSPACE_TEXT 259 // GLFW BACKSPACE: 3 + 256
|
#define KEY_BACKSPACE_TEXT 259 // GLFW BACKSPACE: 3 + 256
|
||||||
|
|
||||||
Vector2 mousePoint = GetMousePosition();
|
Vector2 mousePoint = GetMousePosition();
|
||||||
|
|||||||
Reference in New Issue
Block a user