compute tip scale when loading from brush tips, remove tip_width which was replaced by tip_scale

This commit is contained in:
2019-02-26 17:44:36 +01:00
parent c66edd9b98
commit d7ac967f12
4 changed files with 2 additions and 4 deletions

View File

@@ -339,6 +339,8 @@ bool Brush::load_tip(const std::string& path, const std::string& thumb)
m_tip_texture->auto_destroy = true;
m_brush_path = path;
m_brush_thumb_path = thumb;
auto sz = m_tip_texture->size();
m_tip_scale = sz.y > sz.x ? glm::vec2(sz.x / sz.y, 1.f) : glm::vec2(1.f, sz.y / sz.x);
return true;
}

View File

@@ -24,7 +24,6 @@ public:
glm::vec4 m_tip_color = { 0, 0, 0, 1 };
glm::vec2 m_tip_scale = { 1.f, 1.f };
float m_tip_width = 1.f;
float m_tip_size = 50;
float m_tip_spacing = .25;
float m_tip_flow = 1.f;

View File

@@ -486,7 +486,6 @@ bool NodePanelBrushPreset::save()
i.m_stencil_thumb_path_len = b->m_pattern_thumb_path.size();
i.m_tip_color = b->m_tip_color;
i.m_tip_scale = b->m_tip_scale;
i.m_tip_width = b->m_tip_width;
i.m_tip_size = b->m_tip_size;
i.m_tip_spacing = b->m_tip_spacing;
i.m_tip_flow = b->m_tip_flow;
@@ -590,7 +589,6 @@ bool NodePanelBrushPreset::restore()
auto b = std::make_shared<Brush>();
b->m_tip_color = i.m_tip_color;
b->m_tip_scale = i.m_tip_scale;
b->m_tip_width = i.m_tip_width;
b->m_tip_size = i.m_tip_size;
b->m_tip_spacing = i.m_tip_spacing;
b->m_tip_flow = i.m_tip_flow;

View File

@@ -105,7 +105,6 @@ class NodePanelBrushPreset : public Node
glm::vec4 m_tip_color{ 0, 0, 0, 1 };
glm::vec2 m_tip_scale = { 1.f, 1.f };
float m_tip_width = 1.f;
float m_tip_size = 0;
float m_tip_spacing = 0;
float m_tip_flow = 0;