mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-29 08:34:37 +01:00
Sanity check yOffset. Fixes problem where a scrolled board in
landscape mode is displayed in portrait with the top rows missing though no scrolling should be needed.
This commit is contained in:
parent
f9c9b41b3a
commit
a7d4d20998
1 changed files with 11 additions and 1 deletions
|
@ -1533,9 +1533,19 @@ figureBoardRect( BoardCtxt* board )
|
|||
if ( boardVScale > 0 ) {
|
||||
XP_Rect boardBounds = board->boardBounds;
|
||||
XP_U16 nVisible;
|
||||
XP_U16 nRows = model_numRows( board->model );
|
||||
|
||||
/* Sanity-check yOffset */
|
||||
if ( 0 < board->yOffset ) {
|
||||
XP_S16 maxOffset = nRows -
|
||||
((board->trayBounds.top - boardBounds.top) / board->boardVScale);
|
||||
if ( (maxOffset >= 0) && (maxOffset < board->yOffset) ) {
|
||||
board->yOffset = maxOffset;
|
||||
}
|
||||
}
|
||||
|
||||
boardBounds.width = model_numCols( board->model ) * board->boardHScale;
|
||||
boardBounds.height = (model_numRows( board->model ) - board->yOffset)
|
||||
boardBounds.height = (nRows - board->yOffset)
|
||||
* board->boardVScale;
|
||||
|
||||
if ( board->boardObscuresTray ) {
|
||||
|
|
Loading…
Add table
Reference in a new issue