Route canvas input policy through platform services
This commit is contained in:
@@ -496,6 +496,23 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
[[nodiscard]] bool draws_canvas_tip_for_pointer(
|
||||
bool is_mouse,
|
||||
bool is_stylus,
|
||||
bool is_left_button_release) override
|
||||
{
|
||||
(void)is_left_button_release;
|
||||
return is_mouse || is_stylus;
|
||||
}
|
||||
|
||||
[[nodiscard]] float adjust_canvas_input_pressure(float pressure) override
|
||||
{
|
||||
const 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);
|
||||
};
|
||||
return curve(pressure, 0.95f);
|
||||
}
|
||||
|
||||
[[nodiscard]] pp::platform::PreparedFileTarget prepare_writable_file(
|
||||
std::string_view type,
|
||||
std::string_view default_name,
|
||||
|
||||
Reference in New Issue
Block a user