|
|
Donner SVG Editor & Engine
SVG-native editor and embeddable SVG2 + CSS3 engine in C++20, with GPU (WebGPU) and compact CPU renderers, built for correctness, security, and performance.
|
Drag coalesce policy: decides whether the editor should forward the current mouse position to the backend as a kMove pointer event, or drop it and wait for the in-flight response. More...
#include <optional>#include <type_traits>Namespaces | |
| namespace | donner |
| Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css. | |
Functions | |
| template<typename Vec> | |
| bool | donner::editor::ShouldPostDragMove (const Vec &screenPoint, const std::optional< Vec > &lastPostedScreenPoint, bool pendingFrameInFlight) |
| Coalesce decision. Templated on the cursor type so the same helper works against donner::Vector2d, ImVec2, or any other 2D vector that exposes x / y and supports (a - b).lengthSquared() - either as a member or via a free function. | |
Drag coalesce policy: decides whether the editor should forward the current mouse position to the backend as a kMove pointer event, or drop it and wait for the in-flight response.
Two filters compose:
Both gates must pass for ShouldPostDragMove to return true.
Do not use async-renderer busy state as pendingFrameInFlight for local editor drags. Local drag previews are UI-thread state and must keep updating while the renderer is busy; queued DOM writes coalesce separately.