fix stroke padding rect

This commit is contained in:
2019-07-28 14:51:33 +02:00
parent 37331d4e24
commit 92d4a43fcf
2 changed files with 9 additions and 21 deletions

View File

@@ -606,8 +606,11 @@ void Canvas::stroke_draw()
m_tmp[i].bindFramebuffer();
if (!ShaderManager::ext_framebuffer_fetch)
{
glm::vec2 o = glm::max({0, 0}, xy(b) - pad);
glm::vec2 sz = glm::min(m_size, zw(b) + pad) - o;
m_tex[i].bind();
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, b.x, b.y, b.x, b.y, box_size.x, box_size.y);
if (sz.x > 0 && sz.y > 0)
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, o.x, o.y, o.x, o.y, sz.x, sz.y);
}
m_brush_shape.draw_fill();
m_tmp[i].unbindFramebuffer();
@@ -1228,26 +1231,9 @@ void Canvas::stroke_start(glm::vec3 point, float pressure)
m_dirty_box[i] = glm::vec4(m_width, m_height, 0, 0); // reset bounding box
m_dirty_face[i] = false;
if (l->m_dirty_face[i])
{
m_tmp[i].bindFramebuffer();
// clear
m_tmp[i].clear();
glActiveTexture(GL_TEXTURE1);
m_tex[i].bind();
glCopyTexSubImage2D(GL_TEXTURE_2D, 0,
0, 0, 0, 0, m_width, m_height);
m_tmp[i].copy(l->m_rtt[i]);
m_tmp[i].clear_mask({ 0, 0, 0, 1 });
m_tmp[i].unbindFramebuffer();
}
else
{
m_tmp[i].bindFramebuffer();
m_tmp[i].clear({ 0, 0, 0, 0 });
m_tmp[i].unbindFramebuffer();
}
if (m_current_brush->m_dual_enabled)
{

View File

@@ -167,6 +167,8 @@ void NodeCanvas::draw()
{
use_blend |= m_canvas->m_layers[i]->m_blend_mode != 0;
}
if (Canvas::I->m_current_stroke)
use_blend |= Canvas::I->m_current_stroke->m_brush->m_blend_mode != 0;
if (use_blend)
{