- Posts: 580
- Thank you received: 67
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
zoom problem
IP: 192.168.0.149
13 years 1 month ago #3476
by emanuele
Replied by emanuele on topic zoom problem
What's wrong?
Can you send me also PDFView class?
PDFV class seems to be ok (with the exception of last swiping = NO; in vGetDeltaToCenterPage, that is useless).
Can you send me also PDFView class?
PDFV class seems to be ok (with the exception of last swiping = NO; in vGetDeltaToCenterPage, that is useless).
IP: 192.168.0.149
13 years 1 month ago #3484
by emanuele
Replied by emanuele on topic zoom problem
ok, you have to change some lines:
lines 764, 766, 776, 778 with:
[m_view vGetDeltaToCenterPage:pos.pageno - 1 :&m_swipe_dx :&m_swipe_dy :YES];
lines 107, 690, 788 (the last call in onSwipe method, because is for vertical swipe) with:
[m_view vGetDeltaToCenterPage:pos.pageno :&m_swipe_dx :&m_swipe_dy :NO];
the last line is for swipe capture, line 672:
if( sdel < 0.1 && (sdx > 20 || sdx < -20 || dy > 20 || sdy < -20) )//swipe
Now it should be ok
lines 764, 766, 776, 778 with:
[m_view vGetDeltaToCenterPage:pos.pageno - 1 :&m_swipe_dx :&m_swipe_dy :YES];
lines 107, 690, 788 (the last call in onSwipe method, because is for vertical swipe) with:
[m_view vGetDeltaToCenterPage:pos.pageno :&m_swipe_dx :&m_swipe_dy :NO];
the last line is for swipe capture, line 672:
if( sdel < 0.1 && (sdx > 20 || sdx < -20 || dy > 20 || sdy < -20) )//swipe
Now it should be ok
IP: 192.168.0.149
13 years 1 month ago #3485
by emanuele
Replied by emanuele on topic zoom problem
For lines 764, 766, 776, 778 pos.pageno - 1/pos.pageno + 1 don't have to change, you only have to add :YES
IP: 192.168.0.70
13 years 1 month ago #3639
by stronglee
Replied by stronglee on topic zoom problem
When touches is end PDFView will do this.
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
/*...........*/
if( m_type == 3 || m_type == 4 )
{
struct PDFV_POS pos;
[m_view vGetPos:&pos :m_w/2 :m_h/2];
[m_view vGetDeltaToCenterPage:pos.pageno :&m_swipe_dx :&m_swipe_dy];
}
}
Is other place in touch event you use VGetDeltaToCenterPage Function?
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
/*...........*/
if( m_type == 3 || m_type == 4 )
{
struct PDFV_POS pos;
[m_view vGetPos:&pos :m_w/2 :m_h/2];
[m_view vGetDeltaToCenterPage:pos.pageno :&m_swipe_dx :&m_swipe_dy];
}
}
Is other place in touch event you use VGetDeltaToCenterPage Function?
IP: 192.168.0.70
13 years 4 weeks ago #3731
by truculent
Replied by truculent on topic zoom problem
dear strong lee & emanuele
after you fix my zoom problem [not compleatly we are going to bad bug!] ---> change delate center method
-(void)vGetDeltaToCenterPage:(int)pageno :(int *)dx :(int *)dy :(BOOL)swiping;
and in .m file I change the method implementation:
after zoom & paging reader going crazy & show & change every page on pdf :-o [start from page current & going to page N ]!!!!
in other word our zoom problem not compleate fix!
can you help us for fix it ?
our book is RTL !
we want to simple zoom! and if in zoom mode user want to paging not bug happend
after you fix my zoom problem [not compleatly we are going to bad bug!] ---> change delate center method
-(void)vGetDeltaToCenterPage:(int)pageno :(int *)dx :(int *)dy :(BOOL)swiping;
and in .m file I change the method implementation:
Code:
-(void)vGetDeltaToCenterPage:(int)pageno : (int *)dx : (int *)dy :(BOOL)swiping
{
if (!swiping) {
if( m_pages == NULL || m_doc == NULL || m_w <= 0 || m_h <= 0 || m_scale > m_scale_min) 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;
*dx = x - m_x;
*dy = y - m_y;
}
after zoom & paging reader going crazy & show & change every page on pdf :-o [start from page current & going to page N ]!!!!
in other word our zoom problem not compleate fix!
can you help us for fix it ?
our book is RTL !
we want to simple zoom! and if in zoom mode user want to paging not bug happend
Time to create page: 0.418 seconds