MCPcopy Create free account
hub / github.com/NetHack/NetHack / setTopLeftCell

Method setTopLeftCell

outdated/win/Qt3/qt3tableview.cpp:384–412  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

382*/
383
384void QtTableView::setTopLeftCell( int row, int col )
385{
386 int newX = xOffs;
387 int newY = yOffs;
388
389 if ( col >= 0 ) {
390 if ( cellW ) {
391 newX = col*cellW;
392 if ( newX > maxXOffset() )
393 newX = maxXOffset();
394 } else {
395 newX = 0;
396 while ( col )
397 newX += cellWidth( --col ); // optimize using current! ###
398 }
399 }
400 if ( row >= 0 ) {
401 if ( cellH ) {
402 newY = row*cellH;
403 if ( newY > maxYOffset() )
404 newY = maxYOffset();
405 } else {
406 newY = 0;
407 while ( row )
408 newY += cellHeight( --row ); // optimize using current! ###
409 }
410 }
411 setOffset( newX, newY );
412}
413
414
415/*!

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected