1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:37:35 +00:00

PixelPaint: Relate cursor to brush tool size

This patch changes the cursor for the brush tool to a circle of dynamic
size to indicate the region where the tool will apply color changes.
This commit is contained in:
Torstennator 2022-10-08 16:55:27 +02:00 committed by Linus Groh
parent e9ca641d45
commit e520b9c3a3
6 changed files with 87 additions and 6 deletions

View file

@ -17,6 +17,7 @@
#include "ResizeImageDialog.h"
#include <Applications/PixelPaint/PixelPaintWindowGML.h>
#include <LibConfig/Client.h>
#include <LibCore/Debounce.h>
#include <LibCore/File.h>
#include <LibCore/MimeData.h>
#include <LibFileSystemAccessClient/Client.h>
@ -1100,9 +1101,11 @@ ImageEditor& MainWidget::create_new_editor(NonnullRefPtr<Image> image)
m_show_rulers_action->set_checked(show_rulers);
};
image_editor.on_scale_change = [this](float scale) {
image_editor.on_scale_change = Core::debounce([this](float scale) {
m_zoom_combobox->set_text(String::formatted("{}%", roundf(scale * 100)));
};
current_image_editor()->update_tool_cursor();
},
100);
if (image->layer_count())
image_editor.set_active_layer(&image->layer(0));