mrdoob / frame.js

JavaScript Sequence Editor

Home Page:https://framejs.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Element.duration vs element.end

fernandojsg opened this issue · comments

I've been having problems with the .duration attribute in the timeline/effect element.
I think it could be more useful to use a element.start / element.end values instead of .start / .duration.
For example right now while dragging right or left you have to care and do tricks in cases like for example you go left under 0, or you move start over the end (it keeps moving the block) and things like that.
With start/end you just move one and the other keeps on its place, and just when you move the complete slide just increment both the same amount.
And in anycase in update you could always calculate .duration using both

Yeah. I've always been undecided about that. I think I had duration because it was one thing less to compute per frame...? I see the benefits on the editor side though.

Yep, but the duration could be still part of the timeline object. In fact I recalculate it everytime I call update() based on .end and .start
With those three will be easier to move the block and also keep the restrictions like 0>start>end, start<end<timelinewidth

Sounds good to me :)