fix presets save and restore

This commit is contained in:
2019-02-28 00:22:12 +01:00
parent 0e90264d7c
commit aa189a3468
3 changed files with 26 additions and 15 deletions

View File

@@ -236,7 +236,7 @@ std::vector<StrokeSample> Stroke::compute_samples()
}
else if (m_brush->m_tip_angle_init)
{
s.angle = m_dir_init;
s.angle += m_dir_init;
}
m_prev_sample = s;
@@ -351,7 +351,10 @@ bool Brush::load_tip(const std::string& path, const std::string& thumb)
{
m_tip_texture = std::make_shared<Texture2D>();
if (!m_tip_texture->load(path))
{
m_tip_texture = nullptr;
return false;
}
m_tip_texture->create_mipmaps();
m_tip_texture->auto_destroy = true;
m_brush_path = path;
@@ -365,7 +368,10 @@ bool Brush::load_dual(const std::string& path, const std::string& thumb)
{
m_dual_texture = std::make_shared<Texture2D>();
if (!m_dual_texture->load(path))
{
m_dual_texture = nullptr;
return false;
}
m_dual_texture->create_mipmaps();
m_dual_texture->auto_destroy = true;
m_dual_path = path;
@@ -377,7 +383,10 @@ bool Brush::load_pattern(const std::string& path, const std::string& thumb)
{
m_pattern_texture = std::make_shared<Texture2D>();
if (!m_pattern_texture->load(path))
{
m_pattern_texture = nullptr;
return false;
}
m_pattern_texture->create_mipmaps();
m_pattern_texture->auto_destroy = true;
m_pattern_path = path;