backup commit
This commit is contained in:
9
index.js
9
index.js
@@ -18,7 +18,7 @@ program
|
||||
.option("-i, --stdin", "read the base keyframe data from stdin")
|
||||
.option("-r, --round", "round all generated values.\nyou can set this in the KE_ROUND environment variable", KE_ROUND)
|
||||
.addHelpText("beforeAll", "kdenease.js - generate eases for kdenlive using a cubic bezier curve")
|
||||
.addHelpText("after", "you can use -i to read keyframe data from stdin and overwrite the selected values to the generated values.");
|
||||
.addHelpText("after", "\nyou can use -i to read keyframe data from stdin and overwrite the selected values to the generated values.");
|
||||
|
||||
function decodeKeyframes(kfString) {
|
||||
let out = {};
|
||||
@@ -191,8 +191,11 @@ async function main() {
|
||||
} else {
|
||||
for (let frame in newValues) {
|
||||
if (!baseJSON.value.hasOwnProperty(frame)) {
|
||||
const lastFrame = (frame - 1).toString();
|
||||
const l = baseJSON.value[lastFrame];
|
||||
const l = (() => { // last existing keyframe's value
|
||||
for (let f = parseInt(frame); f >= firstFrame; f--) {
|
||||
if (baseJSON.value.hasOwnProperty(f)) return baseJSON.value[f];
|
||||
}
|
||||
})();
|
||||
baseJSON.value[frame] = { x: l.x, y: l.y, w: l.w, h: l.h };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user