diff --git a/src/settings/settings.h b/src/settings/settings.h index 5c0441237..5d8e9bf7a 100644 --- a/src/settings/settings.h +++ b/src/settings/settings.h @@ -86,6 +86,7 @@ public: virtual int getOpacity() = 0; virtual bool getFilled() = 0; + virtual bool getPreviewFilled() = 0; virtual int getSprayWidth() = 0; virtual int getSpraySpeed() = 0; diff --git a/src/settings/ui_settings_impl.cpp b/src/settings/ui_settings_impl.cpp index 89e279abf..3d2e1b1c4 100644 --- a/src/settings/ui_settings_impl.cpp +++ b/src/settings/ui_settings_impl.cpp @@ -252,6 +252,7 @@ class UIToolSettingsImpl : public IToolSettings UIPenSettingsImpl m_pen; int m_opacity; bool m_filled; + bool m_previewFilled; int m_spray_width; int m_spray_speed; @@ -265,6 +266,7 @@ public: m_opacity = get_config_int(cfg_section.c_str(), "Opacity", 255); m_opacity = MID(0, m_opacity, 255); m_filled = false; + m_previewFilled = get_config_bool(cfg_section.c_str(), "PreviewFilled", false); m_spray_width = 16; m_spray_speed = 32; @@ -295,17 +297,21 @@ public: set_config_int(cfg_section.c_str(), "SprayWidth", m_spray_width); set_config_int(cfg_section.c_str(), "SpraySpeed", m_spray_speed); } + + set_config_bool(cfg_section.c_str(), "PreviewFilled", m_previewFilled); } IPenSettings* getPen() { return &m_pen; } int getOpacity() { return m_opacity; } bool getFilled() { return m_filled; } + bool getPreviewFilled() { return m_previewFilled; } int getSprayWidth() { return m_spray_width; } int getSpraySpeed() { return m_spray_speed; } void setOpacity(int opacity) { m_opacity = opacity; } void setFilled(bool state) { m_filled = state; } + bool setPreviewFilled(bool state) { m_previewFilled = state; } void setSprayWidth(int width) { m_spray_width = width; } void setSpraySpeed(int speed) { m_spray_speed = speed; } diff --git a/src/tools/tool.cpp b/src/tools/tool.cpp index 6f3881ed5..af08e419a 100644 --- a/src/tools/tool.cpp +++ b/src/tools/tool.cpp @@ -18,7 +18,6 @@ #include "config.h" -#include "core/cfg.h" #include "raster/algo.h" #include "raster/image.h" #include "tools/tool.h" @@ -107,7 +106,6 @@ void ToolIntertwine::doPointshapeLine(int x1, int y1, int x2, int y2, IToolLoop* ToolLoopManager::ToolLoopManager(IToolLoop* toolLoop) : m_toolLoop(toolLoop) { - m_previewFilled = get_config_bool("Options", "PreviewFilled", false); } ToolLoopManager::~ToolLoopManager() @@ -225,7 +223,7 @@ void ToolLoopManager::doLoopStep(bool last_step) } // Get the modified area in the sprite with this intertwined set of points - if (!m_toolLoop->getFilled() || (!last_step && !m_previewFilled)) + if (!m_toolLoop->getFilled() || (!last_step && !m_toolLoop->getPreviewFilled())) m_toolLoop->getIntertwine()->joinPoints(m_toolLoop, points_to_interwine); else m_toolLoop->getIntertwine()->fillPoints(m_toolLoop, points_to_interwine); diff --git a/src/tools/tool.h b/src/tools/tool.h index 59a7d7634..b67f01dfd 100644 --- a/src/tools/tool.h +++ b/src/tools/tool.h @@ -284,6 +284,9 @@ public: // To fill a shape, the ToolIntertwine::fillPoints function is used. virtual bool getFilled() = 0; + // Returns true if the preview should be with filled shapes. + virtual bool getPreviewFilled() = 0; + // Spray configuration virtual int getSprayWidth() = 0; virtual int getSpraySpeed() = 0; @@ -343,7 +346,6 @@ class ToolLoopManager IToolLoop* m_toolLoop; std::vector m_points; Point m_oldPoint; - bool m_previewFilled; public: diff --git a/src/widgets/editor/editor.cpp b/src/widgets/editor/editor.cpp index 2d9c3c49c..b19978e74 100644 --- a/src/widgets/editor/editor.cpp +++ b/src/widgets/editor/editor.cpp @@ -1439,6 +1439,7 @@ class ToolLoopImpl : public IToolLoop int m_old_cel_x; int m_old_cel_y; bool m_filled; + bool m_previewFilled; int m_sprayWidth; int m_spraySpeed; TiledMode m_tiled_mode; @@ -1487,6 +1488,7 @@ public: m_filled = settings->getToolSettings(m_tool)->getFilled(); break; } + m_previewFilled = settings->getToolSettings(m_tool)->getPreviewFilled(); m_sprayWidth = settings->getToolSettings(m_tool)->getSprayWidth(); m_spraySpeed = settings->getToolSettings(m_tool)->getSpraySpeed(); @@ -1696,6 +1698,7 @@ public: int getOpacity() { return m_opacity; } TiledMode getTiledMode() { return m_tiled_mode; } bool getFilled() { return m_filled; } + bool getPreviewFilled() { return m_previewFilled; } int getSprayWidth() { return m_sprayWidth; } int getSpraySpeed() { return m_spraySpeed; } Point getOffset() { return m_offset; }