Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect frame after initialization (bug) #50

Closed
sn3p opened this issue Jul 24, 2011 · 2 comments
Closed

Incorrect frame after initialization (bug) #50

sn3p opened this issue Jul 24, 2011 · 2 comments

Comments

@sn3p
Copy link

sn3p commented Jul 24, 2011

Hi pisi,

I found a bug in the frame calculation in jQuery Reel v1.1.3

In this jsfiddle example I set the options { frames: 20, frame: 15 }.
Yet when initialized it shows frame 14.

When you look at the console log you'll see that at first the correct frame is used,
and right after that it jumps to the incorrect frame.

This is happening with several frame values:

frame: 4 jumps to frame 3
frame: 7 jumps to frame 6
frame: 8 jumps to frame 7
frame: 13 jumps to frame 12
frame: 15 jumps to frame 14
frame: 20 jumps to frame 19

Other values show the correct frames.
I've tested in both single row and mutli row mode, but same result.

I'm getting the same result by triggering the "frameChange" event:
$("#reel").trigger('frameChange', 15);

I want to save the current frame and row, so I can later load to the state it was saved in.
Therefore I need the correct values.

Thanks in advance!

UPDATE:
This seems to be the same issue as described by Archivist. My apologies for the duplicate.

@pisi
Copy link
Owner

pisi commented Aug 13, 2011

2011/7/24 sn3p reply@reply.github.com:

Hi pisi,

I'm wondering, how i can get the current row?

I found your jsfiddle sample where you retrieve the current frame via .data("frame").
I tried the same with .data("row") but it returns decimal values between 0 and 1.

See this example: http://jsfiddle.net/wzzyS/

How to get the actual row?

Hi sn3p,

when I follow the github link to this issue
(#50), I see a completely different
post than this one. So here's the answer to the e-mail question
directly:

The "row" data is a bit different from the way values of "frame" work.
It is much more similar to "fraction" data value. Both "row" and
"fraction" have values ranging from 0.00 to 1.00 and in order to get
the actual value like frame, you need to multiply it with the total
number of frames, round the result and you get "frame". "frame" is
stored in the data, but not the "row frame", which you will need to
calculate by multiplying it with number of rows.

Hope this helps,

.pisi

Petr Vostřel ~ petr.vostrel.cz ~ petr@vostrel.cz

@pisi
Copy link
Owner

pisi commented Aug 13, 2011

And to your issue with start frame, it indeed is a duplicate, so I'm closing this issue as a duplicate of #42. Please follow that issue.

@pisi pisi closed this as completed Aug 13, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants