brush scale for non-square brushes

This commit is contained in:
2019-02-24 21:00:53 +01:00
parent 399bc3d433
commit bfaff312f8
9 changed files with 52 additions and 22 deletions

View File

@@ -213,7 +213,7 @@ void CanvasModePen::on_Draw(const glm::mat4& ortho, const glm::mat4& proj, const
ShaderManager::u_int(kShaderUniform::Tex, 0);
float tip_scale_fix = 1.f / glm::tan(glm::radians(Canvas::I->m_cam_fov * 0.5f));
float tip_angle = brush->m_tip_angle * (float)(M_PI * 2.0);
glm::vec2 tip_scale = glm::vec2(brush->m_tip_width, 1.f) *
glm::vec2 tip_scale = brush->m_tip_scale *
glm::vec2(brush->m_tip_size * tip_scale_fix) *
glm::vec2(brush->m_tip_flipx ? -1 : 1, brush->m_tip_flipy ? -1.f : 1.f) *
glm::vec2((brush->m_tip_aspect <= 0.5 ? brush->m_tip_aspect * 2.f : 1.f),