Add "Loop Level" to the Position context reader node (#3679)

* Add "Loop Level" to the Position context reader node

* Remove InjectPosition
This commit is contained in:
Keavon Chambers
2026-01-28 02:52:39 -08:00
committed by GitHub
parent ea293575e0
commit 390004897b
6 changed files with 270 additions and 126 deletions

View File

@@ -1,4 +1,4 @@
use core_types::{Ctx, ExtractAnimationTime, ExtractPointer, ExtractRealTime};
use core_types::{Ctx, ExtractAnimationTime, ExtractPointerPosition, ExtractRealTime};
use glam::DVec2;
const DAY: f64 = 1000. * 3600. * 24.;
@@ -56,8 +56,8 @@ fn animation_time(
/// Produces the current position of the user's pointer within the document canvas.
#[node_macro::node(category("Animation"))]
fn pointer_position(ctx: impl Ctx + ExtractPointer) -> DVec2 {
ctx.try_pointer().unwrap_or_default()
fn pointer_position(ctx: impl Ctx + ExtractPointerPosition) -> DVec2 {
ctx.try_pointer_position().unwrap_or_default()
}
// TODO: These nodes require more sophisticated algorithms for giving the correct result