فهرست منبع

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())
     if (!has_gradient_start_end())
         return;
         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);
     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();
     reset();
 }
 }