GetNHApp()->bNoHScroll = TRUE;
} else {
GetNHApp()->bNoHScroll = FALSE;
- data->xPos = max(0, min(COLNO, u.ux - data->xPageSize/2));
+ data->xPos = max(0, min(COLNO-data->xPageSize+1, u.ux - data->xPageSize/2));
}
si.cbSize = sizeof(si);
GetNHApp()->bNoVScroll = TRUE;
} else {
GetNHApp()->bNoVScroll = FALSE;
- data->yPos = max(0, min(ROWNO, u.uy - data->yPageSize/2));
+ data->yPos = max(0, min(ROWNO-data->yPageSize+1, u.uy - data->yPageSize/2));
}
si.cbSize = sizeof(si);
yNewPos = data->yPos;
}
- yNewPos = max(0, yNewPos);
- yNewPos = min(ROWNO-data->yPageSize+1, yNewPos);
+ yNewPos = max(0, min(ROWNO-data->yPageSize+1, yNewPos));
if( yNewPos == data->yPos ) return;
yDelta = yNewPos - data->yPos;
xNewPos = data->xPos;
}
- xNewPos = max(0, xNewPos);
- xNewPos = min(COLNO-data->xPageSize+1, xNewPos);
+ xNewPos = max(0, min(COLNO-data->xPageSize+1, xNewPos));
if( xNewPos == data->xPos ) return;
xDelta = xNewPos - data->xPos;