add curve to pen pressure on windows
This commit is contained in:
@@ -111,6 +111,12 @@ void CanvasModePen::on_MouseEvent(MouseEvent* me, glm::vec2& loc)
|
||||
if (Canvas::I->m_touch_lock && me->m_source == kEventSource::Touch)
|
||||
return;
|
||||
|
||||
#if _WIN32
|
||||
// curve https://www.wolframalpha.com/input/?i=plot+(1-(x-1)%5E2)%5E2+from+x%3D0+to+1
|
||||
auto curve = [](float x, float max) { return x > max ? 1.f : glm::pow(1.f - glm::pow(x / max - 1.f, 2.f), 2.f); };
|
||||
me->m_pressure = curve(me->m_pressure, 0.95f);
|
||||
#endif
|
||||
|
||||
switch (me->m_type)
|
||||
{
|
||||
case kEventType::MouseDownL:
|
||||
|
||||
Reference in New Issue
Block a user