소스 검색

PixelPaint: Allow the gradient tool to work with selections

Previously the call to layer->did_modify_bitmap() was missing so the
selection was not applied.
MacDue 2 년 전
부모
커밋
69580d7f0e
1개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 6 4
      Userland/Applications/PixelPaint/Tools/GradientTool.cpp

+ 6 - 4
Userland/Applications/PixelPaint/Tools/GradientTool.cpp

@@ -216,12 +216,14 @@ void GradientTool::rasterize_gradient()
 {
     if (!has_gradient_start_end())
         return;
+    auto layer = m_editor->active_layer();
+    if (!layer)
+        return;
 
-    GUI::Painter painter(m_editor->active_layer()->get_scratch_edited_bitmap());
+    GUI::Painter painter(layer->get_scratch_edited_bitmap());
     draw_gradient(painter);
-
-    m_editor->did_complete_action("Gradient Tool"sv);
-
+    layer->did_modify_bitmap(layer->get_scratch_edited_bitmap().rect());
+    m_editor->did_complete_action(tool_name());
     reset();
 }