fix stroke padding rect
This commit is contained in:
@@ -606,8 +606,11 @@ void Canvas::stroke_draw()
|
|||||||
m_tmp[i].bindFramebuffer();
|
m_tmp[i].bindFramebuffer();
|
||||||
if (!ShaderManager::ext_framebuffer_fetch)
|
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();
|
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_brush_shape.draw_fill();
|
||||||
m_tmp[i].unbindFramebuffer();
|
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_box[i] = glm::vec4(m_width, m_height, 0, 0); // reset bounding box
|
||||||
m_dirty_face[i] = false;
|
m_dirty_face[i] = false;
|
||||||
|
|
||||||
if (l->m_dirty_face[i])
|
m_tmp[i].bindFramebuffer();
|
||||||
{
|
m_tmp[i].clear({ 0, 0, 0, 0 });
|
||||||
m_tmp[i].bindFramebuffer();
|
m_tmp[i].unbindFramebuffer();
|
||||||
// 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)
|
if (m_current_brush->m_dual_enabled)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -167,6 +167,8 @@ void NodeCanvas::draw()
|
|||||||
{
|
{
|
||||||
use_blend |= m_canvas->m_layers[i]->m_blend_mode != 0;
|
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)
|
if (use_blend)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user