fix mixer brush uv2 and tip visibility on touch
This commit is contained in:
@@ -391,7 +391,10 @@ void Canvas::stroke_draw()
|
|||||||
vertex_t{ {0, 0, 1, 1}, {1, 0}, {1, 0} },
|
vertex_t{ {0, 0, 1, 1}, {1, 0}, {1, 0} },
|
||||||
};
|
};
|
||||||
for (int j = 0; j < 4; j++)
|
for (int j = 0; j < 4; j++)
|
||||||
|
{
|
||||||
B[j].pos = glm::vec4(xy(s.pos) + off[j] * glm::orientate2(-s.angle), 1, 1);
|
B[j].pos = glm::vec4(xy(s.pos) + off[j] * glm::orientate2(-s.angle), 1, 1);
|
||||||
|
B[j].uvs2 = UV2[j];
|
||||||
|
}
|
||||||
|
|
||||||
glViewport(0, 0, m_width, m_height);
|
glViewport(0, 0, m_width, m_height);
|
||||||
|
|
||||||
@@ -466,9 +469,9 @@ void Canvas::stroke_draw()
|
|||||||
{
|
{
|
||||||
inside++;
|
inside++;
|
||||||
}
|
}
|
||||||
|
//P[j].uvs2 = xy(P[j].pos) / glm::vec2(App::I.width, App::I.height);
|
||||||
P[j].pos.x = -(plane_local.x * 0.5f - 0.5f) * m_width;
|
P[j].pos.x = -(plane_local.x * 0.5f - 0.5f) * m_width;
|
||||||
P[j].pos.y = (plane_local.y * 0.5f + 0.5f) * m_height;
|
P[j].pos.y = (plane_local.y * 0.5f + 0.5f) * m_height;
|
||||||
P[j].uvs2 = UV2[j];
|
|
||||||
|
|
||||||
// Black magic - BEWARE!
|
// Black magic - BEWARE!
|
||||||
// interpolation perspective correction, use the current camera projection to correct the interpolation
|
// interpolation perspective correction, use the current camera projection to correct the interpolation
|
||||||
|
|||||||
@@ -87,10 +87,15 @@ void CanvasModeBasicCamera::on_GestureEvent(GestureEvent* ge)
|
|||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void CanvasModePen::on_GestureEvent(GestureEvent* ge)
|
||||||
|
{
|
||||||
|
m_draw_tip = false;
|
||||||
|
}
|
||||||
|
|
||||||
void CanvasModePen::on_MouseEvent(MouseEvent* me, glm::vec2& loc)
|
void CanvasModePen::on_MouseEvent(MouseEvent* me, glm::vec2& loc)
|
||||||
{
|
{
|
||||||
#if defined(__IOS__)
|
#if defined(__IOS__)
|
||||||
m_draw_tip = (me->m_source == kEventSource::Mouse);
|
m_draw_tip = (me->m_source == kEventSource::Mouse && me->m_type != kEventType::MouseUpL);
|
||||||
#else
|
#else
|
||||||
m_draw_tip = (me->m_source == kEventSource::Mouse || me->m_source == kEventSource::Stylus);
|
m_draw_tip = (me->m_source == kEventSource::Mouse || me->m_source == kEventSource::Stylus);
|
||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
|
|||||||
@@ -66,6 +66,8 @@ class CanvasModePen : public CanvasMode
|
|||||||
bool m_resizing = false;
|
bool m_resizing = false;
|
||||||
public:
|
public:
|
||||||
CanvasModePen() = default;
|
CanvasModePen() = default;
|
||||||
|
|
||||||
|
virtual void on_GestureEvent(GestureEvent* ge) override;
|
||||||
virtual void on_MouseEvent(MouseEvent* me, glm::vec2& loc) override;
|
virtual void on_MouseEvent(MouseEvent* me, glm::vec2& loc) override;
|
||||||
virtual void on_Draw(const glm::mat4& ortho, const glm::mat4& proj, const glm::mat4& camera) override;
|
virtual void on_Draw(const glm::mat4& ortho, const glm::mat4& proj, const glm::mat4& camera) override;
|
||||||
virtual void enter() override;
|
virtual void enter() override;
|
||||||
|
|||||||
Reference in New Issue
Block a user