diff options
author | Andreas Kling <kling@serenityos.org> | 2020-11-24 22:02:34 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-11-24 22:02:34 +0100 |
commit | a43aa82d69d67cce76ba8938ee441e977e37f7ef (patch) | |
tree | b5a53ee8c42ff92666486ec249f2f66cf05d00c9 | |
parent | 3bafef0b159e2acfe3e62da1b5a30f63041d1fdc (diff) | |
download | serenity-a43aa82d69d67cce76ba8938ee441e977e37f7ef.zip |
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 :^)
-rw-r--r-- | DevTools/Profiler/DisassemblyModel.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/DevTools/Profiler/DisassemblyModel.cpp b/DevTools/Profiler/DisassemblyModel.cpp index 13b848642f..9526db156e 100644 --- a/DevTools/Profiler/DisassemblyModel.cpp +++ b/DevTools/Profiler/DisassemblyModel.cpp @@ -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)); } |