skip apple pencil first n samples to overcome the initial pressure spike

This commit is contained in:
2018-10-24 13:10:23 +02:00
parent 73228a4bf1
commit 46a4b217bf
5 changed files with 16 additions and 11 deletions

View File

@@ -206,6 +206,11 @@ void ui::Stroke::add_point(glm::vec2 pos, float pressure)
#ifdef __IOS__
m_curve = glm::min(m_curve + 0.1f, 1.f);
//pressure = pressure * glm::pow(m_curve, 2.f);
if (m_hold_points.size() < 5)
{
m_hold_points.push_back({pos, pressure});
return;
}
#endif // __IOS__
//m_pressure_buff.add(pressure);
//pressure = m_pressure_buff.average();
@@ -227,6 +232,7 @@ void ui::Stroke::add_point(glm::vec2 pos, float pressure)
}
void ui::Stroke::start(const ui::Brush& brush)
{
m_hold_points.clear();
m_curve = 0.f;
m_curve_angles.clear();
m_pressure_buff.clear();