Profiler: Fix assertion when all function samples hit one instruction
If the percentage is 100, we were trying to get the heat gradient pixel at (100, 0), which was one pixel past the end. Fix this by making the heat gradient 101 pixels wide :^)
This commit is contained in:
parent
3bafef0b15
commit
a43aa82d69
Notes:
sideshowbarker
2024-07-19 01:16:22 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/a43aa82d69d
1 changed files with 1 additions and 1 deletions
|
@ -38,7 +38,7 @@ static const Gfx::Bitmap& heat_gradient()
|
|||
{
|
||||
static RefPtr<Gfx::Bitmap> bitmap;
|
||||
if (!bitmap) {
|
||||
bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::RGB32, { 100, 1 });
|
||||
bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::RGB32, { 101, 1 });
|
||||
GUI::Painter painter(*bitmap);
|
||||
painter.fill_rect_with_gradient(Orientation::Horizontal, bitmap->rect(), Color::from_rgb(0xffc080), Color::from_rgb(0xff3000));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue