Update raygui.h
This commit is contained in:
parent
6f9a8088f2
commit
33f43fee2c
16
src/raygui.h
16
src/raygui.h
@ -1757,8 +1757,18 @@ int GuiScrollPanel(Rectangle bounds, const char *text, Rectangle content, Vector
|
||||
|
||||
int horizontalScrollBarWidth = hasHorizontalScrollBar? GuiGetStyle(LISTVIEW, SCROLLBAR_WIDTH) : 0;
|
||||
int verticalScrollBarWidth = hasVerticalScrollBar? GuiGetStyle(LISTVIEW, SCROLLBAR_WIDTH) : 0;
|
||||
Rectangle horizontalScrollBar = { (float)((GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE)? (float)bounds.x + verticalScrollBarWidth : (float)bounds.x) + GuiGetStyle(DEFAULT, BORDER_WIDTH), (float)bounds.y + bounds.height - horizontalScrollBarWidth - GuiGetStyle(DEFAULT, BORDER_WIDTH), (float)bounds.width - verticalScrollBarWidth - 2*GuiGetStyle(DEFAULT, BORDER_WIDTH), (float)horizontalScrollBarWidth };
|
||||
Rectangle verticalScrollBar = { (float)((GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE)? (float)bounds.x + GuiGetStyle(DEFAULT, BORDER_WIDTH) : (float)bounds.x + bounds.width - verticalScrollBarWidth - GuiGetStyle(DEFAULT, BORDER_WIDTH)), (float)bounds.y + GuiGetStyle(DEFAULT, BORDER_WIDTH), (float)verticalScrollBarWidth, (float)bounds.height - horizontalScrollBarWidth - 2*GuiGetStyle(DEFAULT, BORDER_WIDTH) };
|
||||
Rectangle horizontalScrollBar = {
|
||||
(float)((GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE)? (float)bounds.x + verticalScrollBarWidth : (float)bounds.x) + GuiGetStyle(DEFAULT, BORDER_WIDTH),
|
||||
(float)bounds.y + bounds.height - horizontalScrollBarWidth - GuiGetStyle(DEFAULT, BORDER_WIDTH),
|
||||
(float)bounds.width - verticalScrollBarWidth - 2*GuiGetStyle(DEFAULT, BORDER_WIDTH),
|
||||
(float)horizontalScrollBarWidth
|
||||
};
|
||||
Rectangle verticalScrollBar = {
|
||||
(float)((GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE)? (float)bounds.x + GuiGetStyle(DEFAULT, BORDER_WIDTH) : (float)bounds.x + bounds.width - verticalScrollBarWidth - GuiGetStyle(DEFAULT, BORDER_WIDTH)),
|
||||
(float)bounds.y + GuiGetStyle(DEFAULT, BORDER_WIDTH),
|
||||
(float)verticalScrollBarWidth,
|
||||
(float)bounds.height - horizontalScrollBarWidth - 2*GuiGetStyle(DEFAULT, BORDER_WIDTH)
|
||||
};
|
||||
|
||||
// Make sure scroll bars have a minimum width/height
|
||||
// NOTE: If content >>> bounds, size could be very small or even 0
|
||||
@ -4837,7 +4847,7 @@ static void GuiDrawText(const char *text, Rectangle textBounds, int alignment, C
|
||||
}
|
||||
|
||||
#if defined(RAYGUI_DEBUG_TEXT_BOUNDS)
|
||||
GuiDrawRectangle(bounds, 0, WHITE, Fade(BLUE, 0.4f));
|
||||
GuiDrawRectangle(textBounds, 0, WHITE, Fade(BLUE, 0.4f));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user