Changeset 32 for trunk/Lucide/SOURCE/gui


Ignore:
Timestamp:
May 31, 2006, 6:07:08 PM (15 years ago)
Author:
Eugene Romanenko
Message:

preserve scroll pos on resize/zoom.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Lucide/SOURCE/gui/docViewer.cpp

    r28 r32  
    279279{
    280280    zoom = _zoom;
     281
    281282    if ( doc != NULL ) {
    282283        drawPage();
     
    421422    if ( continuous )
    422423    {
    423         adjustSize();
    424424        WinSendMsg( hWndDoc, WM_SIZE, MPFROM2SHORT( cxClient, cyClient ),
    425425                    MPFROM2SHORT( cxClient, cyClient ) );
     
    438438
    439439        Lucide::enableCopy( false );
    440         adjustSize();
    441         sVscrollPos = 0;
    442440        WinSendMsg( hWndDoc, WM_SIZE, MPFROM2SHORT( cxClient, cyClient ),
    443441                    MPFROM2SHORT( cxClient, cyClient ) );
     
    531529    cxClient = SHORT1FROMMP( mp2 );
    532530    cyClient = SHORT2FROMMP( mp2 );
     531
     532    double relativeScrollPos = (double)sVscrollPos / (double)sVscrollMax;
    533533
    534534    adjustSize();
     
    582582    }
    583583    WinEnableWindow( hWndVscroll, (BOOL)( sVscrollMax != 0 ) );
     584
     585    SHORT realScrollPos = (SHORT)(sVscrollMax * relativeScrollPos);
     586    vertScroll( hWndDoc, MPFROM2SHORT( realScrollPos, SB_SLIDERPOSITION ), NULLHANDLE );
    584587}
    585588
Note: See TracChangeset for help on using the changeset viewer.