mirror of
https://github.com/reactos/reactos.git
synced 2024-10-02 15:34:13 +00:00
[CHARMAP]
- Don't go past the scroll range - Reset the grid/cell info when a new font is selected - Should fix some of the issues Vort listed in CORE-10518 svn path=/trunk/; revision=70319
This commit is contained in:
parent
e7b5526683
commit
dcbfa5af55
|
@ -221,7 +221,7 @@ SetFont(PMAP infoPtr,
|
||||||
HDC hdc;
|
HDC hdc;
|
||||||
WCHAR ch[MAX_GLYPHS];
|
WCHAR ch[MAX_GLYPHS];
|
||||||
WORD out[MAX_GLYPHS];
|
WORD out[MAX_GLYPHS];
|
||||||
DWORD i, j, Rows;
|
DWORD i, j;
|
||||||
|
|
||||||
/* Destroy Zoom window, since it was created with older font */
|
/* Destroy Zoom window, since it was created with older font */
|
||||||
DestroyWindow(infoPtr->hLrgWnd);
|
DestroyWindow(infoPtr->hLrgWnd);
|
||||||
|
@ -247,12 +247,7 @@ SetFont(PMAP infoPtr,
|
||||||
NULL,
|
NULL,
|
||||||
TRUE);
|
TRUE);
|
||||||
|
|
||||||
/* Test if zoom window must be reopened */
|
infoPtr->pActiveCell = &infoPtr->Cells[0][0];
|
||||||
if (infoPtr->pActiveCell != NULL &&
|
|
||||||
infoPtr->pActiveCell->bLarge)
|
|
||||||
{
|
|
||||||
CreateLargeCell(infoPtr);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get all the valid glyphs in this font
|
// Get all the valid glyphs in this font
|
||||||
|
|
||||||
|
@ -281,11 +276,14 @@ SetFont(PMAP infoPtr,
|
||||||
|
|
||||||
ReleaseDC(infoPtr->hMapWnd, hdc);
|
ReleaseDC(infoPtr->hMapWnd, hdc);
|
||||||
|
|
||||||
Rows = infoPtr->NumValidGlyphs / XCELLS;
|
infoPtr->NumRows = infoPtr->NumValidGlyphs / XCELLS;
|
||||||
if (infoPtr->NumValidGlyphs % XCELLS)
|
if (infoPtr->NumValidGlyphs % XCELLS)
|
||||||
Rows += 1;
|
infoPtr->NumRows += 1;
|
||||||
|
infoPtr->NumRows = (infoPtr->NumRows > YCELLS) ? infoPtr->NumRows - YCELLS : 0;
|
||||||
|
|
||||||
SetScrollRange(infoPtr->hMapWnd, SB_VERT, 0, Rows - YCELLS, FALSE);
|
SetScrollRange(infoPtr->hMapWnd, SB_VERT, 0, infoPtr->NumRows, FALSE);
|
||||||
|
SetScrollPos(infoPtr->hMapWnd, SB_VERT, 0, TRUE);
|
||||||
|
infoPtr->iYStart = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -463,7 +461,8 @@ OnVScroll(PMAP infoPtr,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
infoPtr->iYStart = max(0, min(infoPtr->iYStart, MAX_ROWS));
|
infoPtr->iYStart = max(0, infoPtr->iYStart);
|
||||||
|
infoPtr->iYStart = min(infoPtr->iYStart, infoPtr->NumRows);
|
||||||
|
|
||||||
iYDiff = iOldYStart - infoPtr->iYStart;
|
iYDiff = iOldYStart - infoPtr->iYStart;
|
||||||
if (iYDiff)
|
if (iYDiff)
|
||||||
|
|
|
@ -47,6 +47,7 @@ typedef struct _MAP
|
||||||
HFONT hFont;
|
HFONT hFont;
|
||||||
LOGFONTW CurrentFont;
|
LOGFONTW CurrentFont;
|
||||||
INT iYStart;
|
INT iYStart;
|
||||||
|
INT NumRows;
|
||||||
|
|
||||||
USHORT ValidGlyphs[MAX_GLYPHS];
|
USHORT ValidGlyphs[MAX_GLYPHS];
|
||||||
USHORT NumValidGlyphs;
|
USHORT NumValidGlyphs;
|
||||||
|
|
Loading…
Reference in a new issue