mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 04:23:51 +00:00
Color plot background.
This commit is contained in:
parent
755df94f45
commit
a3b6a9c95c
@ -28,6 +28,14 @@ static tracy_force_inline uint32_t DarkenColor( uint32_t color )
|
||||
( ( ( ( color & 0x000000FF ) ) * 2 / 3 ) );
|
||||
}
|
||||
|
||||
static tracy_force_inline uint32_t DarkenColorMore( uint32_t color )
|
||||
{
|
||||
return 0xFF000000 |
|
||||
( ( ( ( color & 0x00FF0000 ) >> 16 ) * 1 / 4 ) << 16 ) |
|
||||
( ( ( ( color & 0x0000FF00 ) >> 8 ) * 1 / 4 ) << 8 ) |
|
||||
( ( ( ( color & 0x000000FF ) ) * 1 / 4 ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -174,6 +174,11 @@ int View::DrawPlots( int offset, double pxns, const ImVec2& wpos, bool hover, fl
|
||||
auto& vec = v->data;
|
||||
vec.ensure_sorted();
|
||||
|
||||
const auto color = GetPlotColor( v );
|
||||
const auto bg = 0x22000000 | ( DarkenColorMore( color ) & 0xFFFFFF );
|
||||
|
||||
draw->AddRectFilled( ImVec2( 0, yPos ), ImVec2( w, yPos + PlotHeight ), bg );
|
||||
|
||||
if( v->type == PlotType::Memory )
|
||||
{
|
||||
auto& mem = m_worker.GetMemoryNamed( v->name );
|
||||
@ -273,7 +278,6 @@ int View::DrawPlots( int offset, double pxns, const ImVec2& wpos, bool hover, fl
|
||||
}
|
||||
|
||||
const auto revrange = 1.0 / ( max - min );
|
||||
const auto color = GetPlotColor( v );
|
||||
|
||||
if( it == vec.begin() )
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user