فهرست منبع

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 :^)
Andreas Kling 4 سال پیش
والد
کامیت
a43aa82d69
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      DevTools/Profiler/DisassemblyModel.cpp

+ 1 - 1
DevTools/Profiler/DisassemblyModel.cpp

@@ -38,7 +38,7 @@ static const Gfx::Bitmap& heat_gradient()
 {
 {
     static RefPtr<Gfx::Bitmap> bitmap;
     static RefPtr<Gfx::Bitmap> bitmap;
     if (!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);
         GUI::Painter painter(*bitmap);
         painter.fill_rect_with_gradient(Orientation::Horizontal, bitmap->rect(), Color::from_rgb(0xffc080), Color::from_rgb(0xff3000));
         painter.fill_rect_with_gradient(Orientation::Horizontal, bitmap->rect(), Color::from_rgb(0xffc080), Color::from_rgb(0xff3000));
     }
     }