Route canvas input policy through platform services

This commit is contained in:
2026-06-04 18:26:21 +02:00
parent e52fd3cbb5
commit 4bd29bee9f
10 changed files with 122 additions and 26 deletions

View File

@@ -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,