joseph/Monocle — Issue #98: Offset issues with Monocle on Kindle Fire  
Author: totach
Created: 2012-03-07 21:18:34+00:00
State: open

Im running Monocle in a PhoneGap WebView on Kindle Fire.

I want to calculate the offset positions of elements in the chapter pages relative to the screen.
The Fire returns wrong offset values of elements in the chapter. What's worse is that I cant find a transition to fix the values because:

1. The WebView ignores the columned css style and returns offset values as if the chapter continued below the page bottom so that offsetLeft is between 0 - pageWidth and offsetTop is 0 - required-length-to-fit-the-chapter.

2. At first it seemed simple to solve by: realOffsetTop = offsetTop % pageHeight

3. It doesn't work - in some cases, the last line of text on the page is shifted to the next page even if its offsetTop is smaller than the pageHeight. This is because there isnt enough space to display it on the page. But there is no way to identify this scenario from the code.

Am I missing something? a possible different approach? any clue or direction will be highly appreciated.

Thanks!