mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-18 04:53:06 +01:00
Added optional parameter for imguiEndScrollArea().
This commit is contained in:
@@ -753,7 +753,7 @@ struct Imgui
|
||||
return m_insideScrollArea;
|
||||
}
|
||||
|
||||
void endScrollArea()
|
||||
void endScrollArea(int32_t _r)
|
||||
{
|
||||
// Disable scissoring.
|
||||
m_scissor = UINT16_MAX;
|
||||
@@ -802,36 +802,72 @@ struct Imgui
|
||||
}
|
||||
|
||||
// BG
|
||||
drawRoundedRect( (float)xx
|
||||
, (float)yy
|
||||
, (float)width
|
||||
, (float)height
|
||||
, (float)width / 2 - 1
|
||||
, imguiRGBA(0, 0, 0, 196)
|
||||
);
|
||||
|
||||
// Bar
|
||||
if (isActive(hid) )
|
||||
if (0 == _r)
|
||||
{
|
||||
drawRoundedRect( (float)hx
|
||||
, (float)hy
|
||||
, (float)hw
|
||||
, (float)hh
|
||||
, (float)width / 2 - 1
|
||||
, imguiRGBA(255, 196, 0, 196)
|
||||
drawRect( (float)xx
|
||||
, (float)yy
|
||||
, (float)width
|
||||
, (float)height
|
||||
, imguiRGBA(0, 0, 0, 196)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
drawRoundedRect( (float)hx
|
||||
, (float)hy
|
||||
, (float)hw
|
||||
, (float)hh
|
||||
, (float)width / 2 - 1
|
||||
, isHot(hid) ? imguiRGBA(255, 196, 0, 96) : imguiRGBA(255, 255, 255, 64)
|
||||
drawRoundedRect( (float)xx
|
||||
, (float)yy
|
||||
, (float)width
|
||||
, (float)height
|
||||
, (float)_r
|
||||
, imguiRGBA(0, 0, 0, 196)
|
||||
);
|
||||
}
|
||||
|
||||
// Bar
|
||||
if (isActive(hid) )
|
||||
{
|
||||
if (0 == _r)
|
||||
{
|
||||
drawRect( (float)hx
|
||||
, (float)hy
|
||||
, (float)hw
|
||||
, (float)hh
|
||||
, imguiRGBA(255, 196, 0, 196)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
drawRoundedRect( (float)hx
|
||||
, (float)hy
|
||||
, (float)hw
|
||||
, (float)hh
|
||||
, (float)_r
|
||||
, imguiRGBA(255, 196, 0, 196)
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (0 == _r)
|
||||
{
|
||||
drawRect( (float)hx
|
||||
, (float)hy
|
||||
, (float)hw
|
||||
, (float)hh
|
||||
, isHot(hid) ? imguiRGBA(255, 196, 0, 96) : imguiRGBA(255, 255, 255, 64)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
drawRoundedRect( (float)hx
|
||||
, (float)hy
|
||||
, (float)hw
|
||||
, (float)hh
|
||||
, (float)_r
|
||||
, isHot(hid) ? imguiRGBA(255, 196, 0, 96) : imguiRGBA(255, 255, 255, 64)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Handle mouse scrolling.
|
||||
if (m_insideScrollArea) // && !anyActive() )
|
||||
{
|
||||
@@ -2485,9 +2521,9 @@ bool imguiBeginScrollArea(const char* _name, int32_t _x, int32_t _y, int32_t _wi
|
||||
return s_imgui.beginScrollArea(_name, _x, _y, _width, _height, _scroll, _enabled, _r);
|
||||
}
|
||||
|
||||
void imguiEndScrollArea()
|
||||
void imguiEndScrollArea(int32_t _r)
|
||||
{
|
||||
s_imgui.endScrollArea();
|
||||
s_imgui.endScrollArea(_r);
|
||||
}
|
||||
|
||||
void imguiIndent(uint16_t _width)
|
||||
|
||||
@@ -91,7 +91,7 @@ void imguiEndFrame();
|
||||
bool imguiBorderButton(ImguiBorder::Enum _border, bool _checked, bool _enabled = true);
|
||||
|
||||
bool imguiBeginScrollArea(const char* _name, int _x, int _y, int _width, int _height, int* _scroll, bool _enabled = true, int32_t _r = 6);
|
||||
void imguiEndScrollArea();
|
||||
void imguiEndScrollArea(int32_t _r = 5);
|
||||
|
||||
void imguiIndent(uint16_t _width = 16);
|
||||
void imguiUnindent(uint16_t _width = 16);
|
||||
|
||||
Reference in New Issue
Block a user