Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about iOS development and PDF

TOPIC:

zoom problem 10 years 8 months ago #3476

  • emanuele
  • emanuele's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 580
  • Thank you received: 67
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).

Please Log in or Create an account to join the conversation.

zoom problem 10 years 8 months ago #3479

  • truculent
  • truculent's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 64
  • Thank you received: 0

Please Log in or Create an account to join the conversation.

zoom problem 10 years 8 months ago #3484

  • emanuele
  • emanuele's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 580
  • Thank you received: 67
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

Please Log in or Create an account to join the conversation.

zoom problem 10 years 8 months ago #3485

  • emanuele
  • emanuele's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 580
  • Thank you received: 67
For lines 764, 766, 776, 778 pos.pageno - 1/pos.pageno + 1 don't have to change, you only have to add :YES

Please Log in or Create an account to join the conversation.

zoom problem 10 years 8 months ago #3639

  • stronglee
  • stronglee's Avatar
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 93
  • Thank you received: 2
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?

Please Log in or Create an account to join the conversation.

zoom problem 10 years 7 months ago #3731

  • truculent
  • truculent's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 64
  • Thank you received: 0
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:
-(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 :(

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum