implement brush presets save and restore from file, fix stencil nullptr, limit preview stroke max size

This commit is contained in:
2019-01-23 16:53:58 +01:00
parent e26fcf1163
commit 879be9d4fe
17 changed files with 282 additions and 65 deletions

View File

@@ -201,7 +201,6 @@ void NodeCanvas::draw()
else if(m_canvas->m_current_stroke && m_canvas->m_show_tmp && m_canvas->m_current_layer_idx == layer_index)
{
m_sampler.bind(0);
auto& paper = *m_canvas->m_current_stroke->m_brush->m_stencil_texture;
ShaderManager::use(kShader::CompDraw);
ShaderManager::u_int(kShaderUniform::Tex, 0);
ShaderManager::u_int(kShaderUniform::TexStroke, 1);
@@ -222,9 +221,13 @@ void NodeCanvas::draw()
glActiveTexture(GL_TEXTURE2);
m_canvas->m_smask.m_rtt[plane_index].bindTexture();
glActiveTexture(GL_TEXTURE3);
paper.bind();
if (m_canvas->m_current_stroke->m_brush->m_stencil_texture)
m_canvas->m_current_stroke->m_brush->m_stencil_texture->bind();
else
glBindTexture(GL_TEXTURE_2D, 0);
m_face_plane.draw_fill();
paper.unbind();
if (m_canvas->m_current_stroke->m_brush->m_stencil_texture)
m_canvas->m_current_stroke->m_brush->m_stencil_texture->unbind();
glActiveTexture(GL_TEXTURE2);
m_canvas->m_smask.m_rtt[plane_index].unbindTexture();
glActiveTexture(GL_TEXTURE1);