Ver Fonte

LibGUI: Fix ItemView crash when rubberbanding in main widget view

For some reason this was trying to access the Palette of the parent
widget which is obviously not going to work if the ItemView itself is
the main widget in its window.
Andreas Kling há 5 anos atrás
pai
commit
c7b7b65309
1 ficheiros alterados com 2 adições e 2 exclusões
  1. 2 2
      Libraries/LibGUI/ItemView.cpp

+ 2 - 2
Libraries/LibGUI/ItemView.cpp

@@ -261,8 +261,8 @@ void ItemView::second_paint_event(PaintEvent& event)
     painter.translate(-horizontal_scrollbar().value(), -vertical_scrollbar().value());
     painter.translate(-horizontal_scrollbar().value(), -vertical_scrollbar().value());
 
 
     auto rubber_band_rect = Gfx::Rect::from_two_points(m_rubber_band_origin, m_rubber_band_current);
     auto rubber_band_rect = Gfx::Rect::from_two_points(m_rubber_band_origin, m_rubber_band_current);
-    painter.fill_rect(rubber_band_rect, parent_widget()->palette().rubber_band_fill());
-    painter.draw_rect(rubber_band_rect, parent_widget()->palette().rubber_band_border());
+    painter.fill_rect(rubber_band_rect, palette().rubber_band_fill());
+    painter.draw_rect(rubber_band_rect, palette().rubber_band_border());
 }
 }
 
 
 void ItemView::paint_event(PaintEvent& event)
 void ItemView::paint_event(PaintEvent& event)