Microsoft Windows Phone 8.1 support ends (13 Jul 2017)

Microsoft has ended support for Windows Phone 8.1

Questions about iOS development and PDF

Thumbnail doesn't change automatically

More
IP: 192.168.0.71 11 years 3 months ago - 11 years 3 months ago #7914 by Joyce
I have tried following the solution to modify the position of thumbnail (although instead of horizontal, I am now using vertical one).
By setting int top = 10, the first thumbnail now locates at my desired position.
Yet, when I start scrolling the pdf, I found out that the thumbnail doesn't change accordingly (e.g. upon scrolling from page 1 to page 2 or even page 3, the thumbnail doesn't change, while scrolling up to page 4 will the selected thumbnail changes from 1 to 4).
I have identified the responsible codes for this and which should be vGetDeltaToCenterPage::: in PDFV.m .
I have added the same method for the interface PDFVThmb (so that the codes in other interfaces won't be affected) and are as follows:
Code:
-(void)vGetDeltaToCenterPage:(int)pageno : (int *)dx : (int *)dy { if( m_pages == NULL || m_doc == NULL || m_w <= 0 || m_h <= 0 ) return; PDFVPage *vpage = m_pages[pageno]; int left = [vpage GetX] - m_page_gap/2; int top = [vpage GetY] - m_page_gap/2; int w = [vpage GetWidth] + m_page_gap; int h = [vpage GetHeight] + m_page_gap; int x = left + (w - m_w)/2; int y = top + (h - (m_h/2+10))/2; <------ This line should be modified *dx = x - m_x; *dy = y - m_y; } - (void)vLayout { ...... int top = 10; // original version: int top = m_h/2; ...... }
The original version of that line is
Code:
int y = top + (h - m_h)/2;
Anyone can help me on the calculation? I have tried modifying the line but there are still some cases that the thumbnail doesn't change accordingly.
Any help is appreciated.
Last edit: 11 years 3 months ago by timore. Reason: code modified
More
IP: 192.168.0.71 11 years 3 months ago - 11 years 3 months ago #7918 by radaee
is it this?
int y = top + (h - m_h/2 - 10)/2;
Last edit: 11 years 3 months ago by .
More
IP: 192.168.0.71 11 years 3 months ago - 11 years 3 months ago #7920 by Joyce
In some cases that works, but some still doesn't......
it seems to be related to the height of the thumbnail holding view...

Just an additional piece of information,
in -(void)vLayout
the final line is still
Code:
m_doch = top + m_h/2;
instead of
Code:
m_doch = top + 10;
If I set that to top + 10 (originally I want the last thumbnail to be located at the bottom of the thumbnail holding view),
but it seems that the calculations will be affected.
Last edit: 11 years 3 months ago by timore. Reason: information added
Time to create page: 0.394 seconds
Powered by Kunena Forum