2 * Copyright (C) 2016 Canonical Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18import Lomiri.Components 1.3
19import QtQuick.Window 2.2
20import 'cubic-bezier.js' as Bezier
21import 'KeySpline.js' as KeySpline
26 property var controlPoint1: {'x':0, 'y':0}
27 property var controlPoint2: {'x':0, 'y':0}
28 property var controlPoint3: {'x':0.58, 'y':1}
29 property var controlPoint4: {'x':1, 'y':1}
31 function getValues(t) {
35 return Bezier.getBezier(t, controlPoint1, controlPoint2, controlPoint3, controlPoint4)
38 function getYFromX(x) {
39 var spline = new KeySpline.keySpline(controlPoint2.x, controlPoint2.y, controlPoint3.x, controlPoint3.y)