Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-7574

Bezier or parameterized QEasingCurve

    XMLWordPrintable

Details

    • b9f0bde16e85161666d5090952955bebacc40f89

    Description

      I'm looking into using the Qt animation framework to implement QtWebkit's CSS animations.
      As most of the work is done, one thing I can't do is use QEasingCurve.
      The reason is that Webkit represents easing-curves as beziers (4 points). The beziers don't translate to the off-the-shelf enum types (unless I try to reverse engineer them), and the customType mechanism is non-parameterized: it's qreal func(qreal), meaning it has to be an absolute formula that cannot rely on dynamic data.
      This means that I have to reimp QVariantAnimation::interpolated in order to achieve a simple bezier-curve for the easing!

      I'd like us to consider one (or both) of two alternatives:
      1. provide an off-the-shelf bezier-curve support in QEasingCurve, something like QEasingCurve::fromBezier(a, b, c, d)
      2. have another EasingFunction-like type that's like qreal func(qreal progress, const QVariant & userData), where I can use userData to include something like the bezier's 4-points

      Note that this is not webkit specific - if we talk about a future design tool, designers might want to edit beziers by hand and not rely on our off-the-shelf types.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thohartm Thomas Hartmann
            noam Noam Rosenthal
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes