mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-06 12:39:57 +00:00
Added "pixel grid" in ISettings interface.
This commit is contained in:
parent
b935f90cd3
commit
4807de27b4
@ -60,6 +60,14 @@ public:
|
||||
virtual void setGridBounds(Rect rect) = 0;
|
||||
virtual void setGridColor(color_t color) = 0;
|
||||
|
||||
// Pixel grid
|
||||
|
||||
virtual bool getPixelGridVisible() = 0;
|
||||
virtual color_t getPixelGridColor() = 0;
|
||||
|
||||
virtual void setPixelGridVisible(bool state) = 0;
|
||||
virtual void setPixelGridColor(color_t color) = 0;
|
||||
|
||||
// Onionskin settings
|
||||
|
||||
virtual bool getUseOnionskin() = 0;
|
||||
|
@ -43,6 +43,8 @@ UISettingsImpl::UISettingsImpl()
|
||||
m_gridVisible = get_config_bool("Grid", "Visible", false);
|
||||
m_gridColor = get_config_color("Grid", "Color", color_rgb(0, 0, 255));
|
||||
m_gridBounds = get_config_rect("Grid", "Bounds", m_gridBounds);
|
||||
m_pixelGridVisible = get_config_bool("PixelGrid", "Visible", false);
|
||||
m_pixelGridColor = get_config_color("PixelGrid", "Color", color_rgb(200, 200, 200));
|
||||
}
|
||||
|
||||
UISettingsImpl::~UISettingsImpl()
|
||||
@ -53,6 +55,8 @@ UISettingsImpl::~UISettingsImpl()
|
||||
set_config_bool("Grid", "Visible", m_gridVisible);
|
||||
set_config_rect("Grid", "Bounds", m_gridBounds);
|
||||
set_config_color("Grid", "Color", m_gridColor);
|
||||
set_config_bool("PixelGrid", "Visible", m_pixelGridVisible);
|
||||
set_config_color("PixelGrid", "Color", m_pixelGridColor);
|
||||
|
||||
// delete all tool settings
|
||||
std::map<std::string, IToolSettings*>::iterator it;
|
||||
@ -158,6 +162,29 @@ void UISettingsImpl::setGridColor(color_t color)
|
||||
m_gridColor = color;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Pixel grid
|
||||
|
||||
bool UISettingsImpl::getPixelGridVisible()
|
||||
{
|
||||
return m_pixelGridVisible;
|
||||
}
|
||||
|
||||
color_t UISettingsImpl::getPixelGridColor()
|
||||
{
|
||||
return m_pixelGridColor;
|
||||
}
|
||||
|
||||
void UISettingsImpl::setPixelGridVisible(bool state)
|
||||
{
|
||||
m_pixelGridVisible = state;
|
||||
}
|
||||
|
||||
void UISettingsImpl::setPixelGridColor(color_t color)
|
||||
{
|
||||
m_pixelGridColor = color;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Onionskin settings
|
||||
|
||||
|
@ -25,15 +25,6 @@
|
||||
|
||||
class UISettingsImpl : public ISettings
|
||||
{
|
||||
TiledMode m_tiledMode;
|
||||
Tool* m_currentTool;
|
||||
bool m_use_onionskin;
|
||||
bool m_snapToGrid;
|
||||
bool m_gridVisible;
|
||||
Rect m_gridBounds;
|
||||
color_t m_gridColor;
|
||||
std::map<std::string, IToolSettings*> m_toolSettings;
|
||||
|
||||
public:
|
||||
UISettingsImpl();
|
||||
~UISettingsImpl();
|
||||
@ -62,6 +53,14 @@ public:
|
||||
void setGridBounds(Rect rect);
|
||||
void setGridColor(color_t color);
|
||||
|
||||
// Pixel grid
|
||||
|
||||
bool getPixelGridVisible();
|
||||
color_t getPixelGridColor();
|
||||
|
||||
void setPixelGridVisible(bool state);
|
||||
void setPixelGridColor(color_t color);
|
||||
|
||||
// Onionskin settings
|
||||
|
||||
bool getUseOnionskin();
|
||||
@ -75,7 +74,18 @@ public:
|
||||
// Tools settings
|
||||
|
||||
IToolSettings* getToolSettings(Tool* tool);
|
||||
|
||||
|
||||
private:
|
||||
TiledMode m_tiledMode;
|
||||
Tool* m_currentTool;
|
||||
bool m_use_onionskin;
|
||||
bool m_snapToGrid;
|
||||
bool m_gridVisible;
|
||||
Rect m_gridBounds;
|
||||
color_t m_gridColor;
|
||||
bool m_pixelGridVisible;
|
||||
color_t m_pixelGridColor;
|
||||
std::map<std::string, IToolSettings*> m_toolSettings;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user