diff --git a/Userland/Applications/PixelPaint/CMakeLists.txt b/Userland/Applications/PixelPaint/CMakeLists.txt index 7c87a29487..27618d1ed0 100644 --- a/Userland/Applications/PixelPaint/CMakeLists.txt +++ b/Userland/Applications/PixelPaint/CMakeLists.txt @@ -44,4 +44,4 @@ set(SOURCES ) serenity_app(PixelPaint ICON app-pixel-paint) -target_link_libraries(PixelPaint LibImageDecoderClient LibGUI LibGfx LibFileSystemAccessClient) +target_link_libraries(PixelPaint LibImageDecoderClient LibGUI LibGfx LibFileSystemAccessClient LibConfig) diff --git a/Userland/Applications/PixelPaint/ImageEditor.cpp b/Userland/Applications/PixelPaint/ImageEditor.cpp index ce8f2a4fcd..9c23d4f065 100644 --- a/Userland/Applications/PixelPaint/ImageEditor.cpp +++ b/Userland/Applications/PixelPaint/ImageEditor.cpp @@ -12,6 +12,7 @@ #include "Layer.h" #include "MoveTool.h" #include "Tool.h" +#include #include #include #include @@ -29,6 +30,7 @@ ImageEditor::ImageEditor(NonnullRefPtr image) m_undo_stack = make(); m_undo_stack->push(make(*m_image)); m_image->add_client(*this); + m_pixel_grid_threshold = (float)Config::read_i32("PixelPaint", "PixelGrid", "Threshold", 15); } ImageEditor::~ImageEditor() @@ -86,8 +88,7 @@ void ImageEditor::paint_event(GUI::PaintEvent& event) painter.draw_rect(enclosing_int_rect(image_rect_to_editor_rect(m_active_layer->relative_rect())).inflated(2, 2), Color::Black); } - const float pixel_grid_threshold = 15.0f; - if (m_show_pixel_grid && m_scale > pixel_grid_threshold) { + if (m_show_pixel_grid && m_scale > m_pixel_grid_threshold) { auto event_image_rect = enclosing_int_rect(editor_rect_to_image_rect(event.rect())).inflated(1, 1); auto image_rect = m_image->rect().inflated(1, 1).intersected(event_image_rect); diff --git a/Userland/Applications/PixelPaint/ImageEditor.h b/Userland/Applications/PixelPaint/ImageEditor.h index e42df9035f..051d03dd25 100644 --- a/Userland/Applications/PixelPaint/ImageEditor.h +++ b/Userland/Applications/PixelPaint/ImageEditor.h @@ -157,6 +157,8 @@ private: int m_ruler_thickness { 20 }; int m_mouse_indicator_triangle_size { 5 }; + float m_pixel_grid_threshold { 15.0f }; + Gfx::StandardCursor m_active_cursor { Gfx::StandardCursor::None }; Selection m_selection; diff --git a/Userland/Applications/PixelPaint/main.cpp b/Userland/Applications/PixelPaint/main.cpp index c2ecb89fda..bad0004826 100644 --- a/Userland/Applications/PixelPaint/main.cpp +++ b/Userland/Applications/PixelPaint/main.cpp @@ -6,6 +6,7 @@ */ #include "MainWidget.h" +#include #include #include #include @@ -26,6 +27,7 @@ int main(int argc, char** argv) } auto app = GUI::Application::construct(argc, argv); + Config::pledge_domains("PixelPaint"); const char* image_file = nullptr; Core::ArgsParser args_parser;