Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
1abbb78a
Commit
1abbb78a
authored
Oct 27, 2020
by
Huw Davies
Committed by
Alexandre Julliard
Oct 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Use row and para ptrs in the ensure visible function.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
30ad0b93
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
21 deletions
+18
-21
caret.c
dlls/riched20/caret.c
+4
-6
editor.c
dlls/riched20/editor.c
+1
-1
editor.h
dlls/riched20/editor.h
+1
-1
paint.c
dlls/riched20/paint.c
+12
-13
No files found.
dlls/riched20/caret.c
View file @
1abbb78a
...
...
@@ -1176,13 +1176,11 @@ void ME_MouseMove(ME_TextEditor *editor, int x, int y)
if
(
editor
->
nSelectionType
!=
stPosition
&&
memcmp
(
&
editor
->
pCursors
[
1
],
&
editor
->
pCursors
[
3
],
sizeof
(
ME_Cursor
)))
{
/* The scroll the cursor towards the other end, since it was the one
* extended by ME_ExtendAnchorSelection */
ME_EnsureVisible
(
editor
,
&
editor
->
pCursors
[
1
]);
}
else
{
ME_EnsureVisible
(
editor
,
&
editor
->
pCursors
[
0
]);
}
editor_ensure_visible
(
editor
,
&
editor
->
pCursors
[
1
]
);
else
editor_ensure_visible
(
editor
,
&
editor
->
pCursors
[
0
]
);
ME_InvalidateSelection
(
editor
);
update_caret
(
editor
);
...
...
@@ -1520,7 +1518,7 @@ ME_ArrowKey(ME_TextEditor *editor, int nVKey, BOOL extend, BOOL ctrl)
ME_InvalidateSelection
(
editor
);
ME_Repaint
(
editor
);
hide_caret
(
editor
);
ME_EnsureVisible
(
editor
,
&
tmp_curs
);
editor_ensure_visible
(
editor
,
&
tmp_curs
);
update_caret
(
editor
);
ME_SendSelChange
(
editor
);
return
success
;
...
...
dlls/riched20/editor.c
View file @
1abbb78a
...
...
@@ -4095,7 +4095,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
return
len
;
}
case
EM_SCROLLCARET
:
ME_EnsureVisible
(
editor
,
&
editor
->
pCursors
[
0
]
);
editor_ensure_visible
(
editor
,
&
editor
->
pCursors
[
0
]
);
return
0
;
case
WM_SETFONT
:
{
...
...
dlls/riched20/editor.h
View file @
1abbb78a
...
...
@@ -242,7 +242,7 @@ void ME_PaintContent(ME_TextEditor *editor, HDC hDC, const RECT *rcUpdate) DECLS
void
ME_Repaint
(
ME_TextEditor
*
editor
)
DECLSPEC_HIDDEN
;
void
ME_RewrapRepaint
(
ME_TextEditor
*
editor
)
DECLSPEC_HIDDEN
;
void
ME_UpdateRepaint
(
ME_TextEditor
*
editor
,
BOOL
update_now
)
DECLSPEC_HIDDEN
;
void
ME_EnsureVisible
(
ME_TextEditor
*
editor
,
ME_Cursor
*
pCursor
)
DECLSPEC_HIDDEN
;
void
editor_ensure_visible
(
ME_TextEditor
*
editor
,
ME_Cursor
*
cursor
)
DECLSPEC_HIDDEN
;
void
ME_InvalidateSelection
(
ME_TextEditor
*
editor
)
DECLSPEC_HIDDEN
;
BOOL
ME_SetZoom
(
ME_TextEditor
*
editor
,
int
numerator
,
int
denominator
)
DECLSPEC_HIDDEN
;
int
ME_twips2pointsX
(
const
ME_Context
*
c
,
int
x
)
DECLSPEC_HIDDEN
;
...
...
dlls/riched20/paint.c
View file @
1abbb78a
...
...
@@ -117,7 +117,7 @@ void ME_UpdateRepaint(ME_TextEditor *editor, BOOL update_now)
ME_UpdateScrollBar
(
editor
);
/* Ensure that the cursor is visible */
ME_EnsureVisible
(
editor
,
&
editor
->
pCursors
[
0
]
);
editor_ensure_visible
(
editor
,
&
editor
->
pCursors
[
0
]
);
ITextHost_TxViewChange
(
editor
->
texthost
,
update_now
);
...
...
@@ -1269,19 +1269,17 @@ void ME_UpdateScrollBar(ME_TextEditor *editor)
}
}
void
ME_EnsureVisible
(
ME_TextEditor
*
editor
,
ME_Cursor
*
pCursor
)
void
editor_ensure_visible
(
ME_TextEditor
*
editor
,
ME_Cursor
*
cursor
)
{
ME_Run
*
pRun
=
&
pC
ursor
->
pRun
->
member
.
run
;
ME_
DisplayItem
*
pRow
=
ME_FindItemBack
(
pCursor
->
pRun
,
diStartRow
);
ME_
DisplayItem
*
pPara
=
pCursor
->
pP
ara
;
ME_Run
*
run
=
&
c
ursor
->
pRun
->
member
.
run
;
ME_
Row
*
row
=
row_from_cursor
(
cursor
);
ME_
Paragraph
*
para
=
&
cursor
->
pPara
->
member
.
p
ara
;
int
x
,
y
,
yheight
;
assert
(
pRow
);
assert
(
pPara
);
if
(
editor
->
styleFlags
&
ES_AUTOHSCROLL
)
{
x
=
pRun
->
pt
.
x
+
ME_PointFromChar
(
editor
,
pRun
,
pCursor
->
nOffset
,
TRUE
);
x
=
run
->
pt
.
x
+
ME_PointFromChar
(
editor
,
run
,
cursor
->
nOffset
,
TRUE
);
if
(
x
>
editor
->
horz_si
.
nPos
+
editor
->
sizeWindow
.
cx
)
x
=
x
+
1
-
editor
->
sizeWindow
.
cx
;
else
if
(
x
>
editor
->
horz_si
.
nPos
)
...
...
@@ -1292,14 +1290,15 @@ void ME_EnsureVisible(ME_TextEditor *editor, ME_Cursor *pCursor)
ME_HScrollAbs
(
editor
,
x
);
return
;
}
}
else
{
if
(
~
editor
->
styleFlags
&
ES_AUTOVSCROLL
)
return
;
}
else
{
if
(
~
editor
->
styleFlags
&
ES_AUTOVSCROLL
)
return
;
x
=
editor
->
horz_si
.
nPos
;
}
y
=
p
Para
->
member
.
para
.
pt
.
y
+
pRow
->
member
.
row
.
pt
.
y
;
yheight
=
pRow
->
member
.
row
.
nHeight
;
y
=
p
ara
->
pt
.
y
+
row
->
pt
.
y
;
yheight
=
row
->
nHeight
;
if
(
y
<
editor
->
vert_si
.
nPos
)
ME_ScrollAbs
(
editor
,
x
,
y
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment