Commit 2f07df59 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

riched20: Add a helper to return the default line height and use that in EM_LINESCROLL.

parent e168cd28
...@@ -2925,6 +2925,16 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) ...@@ -2925,6 +2925,16 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
return TRUE; return TRUE;
} }
static inline int get_default_line_height( ME_TextEditor *editor )
{
int height = 0;
if (editor->pBuffer && editor->pBuffer->pDefaultStyle)
height = editor->pBuffer->pDefaultStyle->tm.tmHeight;
if (height <= 0) height = 24;
return height;
}
static const char * const edit_messages[] = { static const char * const edit_messages[] = {
"EM_GETSEL", "EM_GETSEL",
...@@ -3548,7 +3558,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, ...@@ -3548,7 +3558,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
{ {
if (!(editor->styleFlags & ES_MULTILINE)) if (!(editor->styleFlags & ES_MULTILINE))
return FALSE; return FALSE;
ME_ScrollDown(editor, lParam * 8); /* FIXME follow the original */ ME_ScrollDown( editor, lParam * get_default_line_height( editor ) );
return TRUE; return TRUE;
} }
case WM_CLEAR: case WM_CLEAR:
...@@ -4221,14 +4231,9 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam, ...@@ -4221,14 +4231,9 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
case WM_VSCROLL: case WM_VSCROLL:
{ {
int origNPos; int origNPos;
int lineHeight; int lineHeight = get_default_line_height( editor );
origNPos = editor->vert_si.nPos; origNPos = editor->vert_si.nPos;
lineHeight = 24;
if (editor->pBuffer && editor->pBuffer->pDefaultStyle)
lineHeight = editor->pBuffer->pDefaultStyle->tm.tmHeight;
if (lineHeight <= 0) lineHeight = 24;
switch(LOWORD(wParam)) switch(LOWORD(wParam))
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment