Replies: 5 comments 6 replies
-
Related? |
Beta Was this translation helpful? Give feedback.
-
Great, thanks for the feedback. I'm certainly open to changes and being careful about how we approach things. Here is my revised implementation (incorporating the feedback, thanks for that). Proposed ImplementationThis plan is designed to be minimally invasive. A. New File:
|
Beta Was this translation helpful? Give feedback.
-
Just checking in — since the full code is already in the discussion above and incorporates the feedback, do you want me to submit a formal PR as well, or are we happy to proceed from here? Happy to create the PR if that’s the preferred next step. Cheers, |
Beta Was this translation helpful? Give feedback.
-
Animation lib updateHey all — just a quick update after a few weeks on this. The little easing header I dropped earlier has grown into a proper animation lib. What’s working now What’s different from the old stuff Next steps — overall this feels like the right replacement path for the old helpers: lighter, cleaner, but with far more reach. Close to PR-ready now. |
Beta Was this translation helpful? Give feedback.
-
woow. Finished the GUI test suit. ![]() Man this has been a lot of work... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Below is the same proposal with the correct file paths and a couple of wording tweaks so nobody has to hunt for headers again.
Industrial Bézier Curve Engine for U++ Animation
U++ 2025.1 shipped the first
Animate()
helper, but it only slides a widget’s rectangle with a fixed linear timer.This patch adds a tiny cubic-Bézier API plus a generic
AnimateProperty()
template so any property—position, size, colour, opacity, angle—can move with ease-in, ease-out, or a designer-supplied curve. Four doubles describe the spline; classic helpers likeEaseInQuad
are just wrappers. Everything is header-only,constexpr
, and costs four multiplies per frame.Cubic-Bézier timing is standard in CSS, Qt, WPF, and Flutter, evaluated with the de Casteljau algorithm.
1 · Minimal source changes
Core/Util.h
template<class T> constexpr T Lerp(const T&, const T&, double, Upp::Easing::Fn) noexcept
→ returnsLerp(a,b,fn(t))
.CtrlLib/CtrlUtil.h
.Easing(Fn)
.• Add
template <class T> void AnimateProperty(...)
(timer loop + newLerp
).CtrlLib/Easing.h
(new)using Fn
.No
.cpp
files are needed; everything is inline.2 ·
Easing.h
(drop-in)The curve must start (0,0) and end (1,1)—same rule as Qt
QEasingCurve::BezierSpline
and WPFKeySpline
.3 · Usage examples
Everything compiles after the three tiny edits above.
4 · Why this matters
(0,0,1,1)
.Fn
typedef.Copy
Easing.h
, add the two small patches, rebuild TheIDE, and your widgets will glide like any modern toolkit.Beta Was this translation helpful? Give feedback.
All reactions