Changeset 77 for trunk/Lucide
 Timestamp:
 Jul 16, 2006, 1:40:26 PM (15 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/Lucide/SOURCE/gui/docViewer.cpp
r74 r77 1301 1301 void DocumentViewer::winPosToDocPos( PPOINTL startpoint, PPOINTL endpoint, LuRectangle *r ) 1302 1302 { 1303 r>x1 = ( startpoint>x + sHscrollPos ) / realzoom; 1304 r>y1 = ( ( cyClient  startpoint>y ) + sVscrollPos ) / realzoom; 1305 r>x2 = ( endpoint>x + sHscrollPos ) / realzoom; 1306 r>y2 = ( ( cyClient  endpoint>y ) + sVscrollPos ) / realzoom; 1303 LONG sx = startpoint>x; 1304 LONG sy = startpoint>y; 1305 LONG ex = endpoint>x; 1306 LONG ey = endpoint>y; 1307 if ( width < cxClient ) { 1308 LONG xPos = ( cxClient  width ) / 2; 1309 sx = xPos; 1310 ex = xPos; 1311 } 1312 if ( height < cyClient ) { 1313 LONG yPos = ( cyClient  height ) / 2; 1314 sy += yPos; 1315 ey += yPos; 1316 } 1317 1318 r>x1 = ( sx + sHscrollPos ) / realzoom; 1319 r>y1 = ( ( cyClient  sy ) + sVscrollPos ) / realzoom; 1320 r>x2 = ( ex + sHscrollPos ) / realzoom; 1321 r>y2 = ( ( cyClient  ey ) + sVscrollPos ) / realzoom; 1307 1322 1308 1323 rotateRectangle( currentpage, r ); … … 1313 1328 void DocumentViewer::winPosToDocPos( PageDrawArea *pda, LuRectangle *r ) 1314 1329 { 1315 r>x1 = ( sHscrollPos + pda>drawrect.xLeft ) / realzoom;; 1330 LONG sx = pda>drawrect.xLeft; 1331 LONG ex = pda>drawrect.xRight; 1332 double w = pagesizes[ pda>pagenum ].x * realzoom; 1333 if ( w < cxClient ) { 1334 LONG xPos = ( cxClient  w ) / 2; 1335 sx = xPos; 1336 ex = xPos; 1337 } 1338 1339 r>x1 = ( sHscrollPos + sx ) / realzoom;; 1316 1340 r>y1 = pda>startpos.y / realzoom; 1317 r>x2 = ( ( pda>drawrect.xRight  pda>drawrect.xLeft) / realzoom ) + r>x1;1341 r>x2 = ( ( ex  sx ) / realzoom ) + r>x1; 1318 1342 r>y2 = ( ( pda>drawrect.yTop  pda>drawrect.yBottom ) / realzoom ) + r>y1; 1319 1343 … … 1359 1383 rcl>xRight = ( tmp_x2 * realzoom )  sHscrollPos; 1360 1384 rcl>yTop = cyClient  ( yplus + ( tmp_y1 * realzoom ) ) + ( sVscrollPos * VScrollStep ); 1385 1386 LONG pw = w * realzoom; 1387 if ( pw < cxClient ) { 1388 LONG xPos = ( cxClient  pw ) / 2; 1389 rcl>xLeft += xPos; 1390 rcl>xRight += xPos; 1391 } 1392 if ( !continuous ) 1393 { 1394 LONG ph = h * realzoom; 1395 if ( ph < cyClient ) { 1396 LONG yPos = ( cyClient  ph ) / 2; 1397 rcl>yBottom = yPos; 1398 rcl>yTop = yPos; 1399 } 1400 } 1361 1401 } 1362 1402
Note: See TracChangeset
for help on using the changeset viewer.