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
304c8320
Commit
304c8320
authored
Oct 04, 2016
by
Huw Davies
Committed by
Alexandre Julliard
Oct 04, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Allow selecting the final end-of-paragraph when using the mouse.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7eb68377
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
caret.c
dlls/riched20/caret.c
+8
-9
No files found.
dlls/riched20/caret.c
View file @
304c8320
...
@@ -961,11 +961,13 @@ static BOOL ME_FindRunInRow(ME_TextEditor *editor, ME_DisplayItem *pRow,
...
@@ -961,11 +961,13 @@ static BOOL ME_FindRunInRow(ME_TextEditor *editor, ME_DisplayItem *pRow,
* x & y are pixel positions in virtual coordinates into the rich edit control,
* x & y are pixel positions in virtual coordinates into the rich edit control,
* so client coordinates must first be adjusted by the scroll position.
* so client coordinates must first be adjusted by the scroll position.
*
*
* If final_eop is TRUE consider the final end-of-paragraph.
*
* returns TRUE if the result was exactly under the cursor, otherwise returns
* returns TRUE if the result was exactly under the cursor, otherwise returns
* FALSE, and result is set to the closest position to the coordinates.
* FALSE, and result is set to the closest position to the coordinates.
*/
*/
static
BOOL
ME_FindPixelPos
(
ME_TextEditor
*
editor
,
int
x
,
int
y
,
static
BOOL
ME_FindPixelPos
(
ME_TextEditor
*
editor
,
int
x
,
int
y
,
ME_Cursor
*
result
,
BOOL
*
is_eol
)
ME_Cursor
*
result
,
BOOL
*
is_eol
,
BOOL
final_eop
)
{
{
ME_DisplayItem
*
p
=
editor
->
pBuffer
->
pFirst
->
member
.
para
.
next_para
;
ME_DisplayItem
*
p
=
editor
->
pBuffer
->
pFirst
->
member
.
para
.
next_para
;
BOOL
isExact
=
TRUE
;
BOOL
isExact
=
TRUE
;
...
@@ -1001,7 +1003,7 @@ static BOOL ME_FindPixelPos(ME_TextEditor *editor, int x, int y,
...
@@ -1001,7 +1003,7 @@ static BOOL ME_FindPixelPos(ME_TextEditor *editor, int x, int y,
if
(
!
pp
)
break
;
if
(
!
pp
)
break
;
p
=
pp
;
p
=
pp
;
}
}
if
(
p
==
editor
->
pBuffer
->
pLast
)
if
(
p
==
editor
->
pBuffer
->
pLast
&&
!
final_eop
)
{
{
/* The position is below the last paragraph, so the last row will be used
/* The position is below the last paragraph, so the last row will be used
* rather than the end of the text, so the x position will be used to
* rather than the end of the text, so the x position will be used to
...
@@ -1016,10 +1018,7 @@ static BOOL ME_FindPixelPos(ME_TextEditor *editor, int x, int y,
...
@@ -1016,10 +1018,7 @@ static BOOL ME_FindPixelPos(ME_TextEditor *editor, int x, int y,
if
(
p
->
type
==
diStartRow
)
if
(
p
->
type
==
diStartRow
)
return
ME_FindRunInRow
(
editor
,
p
,
x
,
result
,
is_eol
)
&&
isExact
;
return
ME_FindRunInRow
(
editor
,
p
,
x
,
result
,
is_eol
)
&&
isExact
;
result
->
pRun
=
ME_FindItemBack
(
p
,
diRun
);
ME_SetCursorToEnd
(
editor
,
result
,
TRUE
);
result
->
pPara
=
ME_GetParagraph
(
result
->
pRun
);
result
->
nOffset
=
0
;
assert
(
result
->
pRun
->
member
.
run
.
nFlags
&
MERF_ENDPARA
);
return
FALSE
;
return
FALSE
;
}
}
...
@@ -1047,7 +1046,7 @@ BOOL ME_CharFromPos(ME_TextEditor *editor, int x, int y,
...
@@ -1047,7 +1046,7 @@ BOOL ME_CharFromPos(ME_TextEditor *editor, int x, int y,
}
}
x
+=
editor
->
horz_si
.
nPos
;
x
+=
editor
->
horz_si
.
nPos
;
y
+=
editor
->
vert_si
.
nPos
;
y
+=
editor
->
vert_si
.
nPos
;
bResult
=
ME_FindPixelPos
(
editor
,
x
,
y
,
cursor
,
NULL
);
bResult
=
ME_FindPixelPos
(
editor
,
x
,
y
,
cursor
,
NULL
,
FALSE
);
if
(
isExact
)
*
isExact
=
bResult
;
if
(
isExact
)
*
isExact
=
bResult
;
return
TRUE
;
return
TRUE
;
}
}
...
@@ -1130,7 +1129,7 @@ void ME_LButtonDown(ME_TextEditor *editor, int x, int y, int clickNum)
...
@@ -1130,7 +1129,7 @@ void ME_LButtonDown(ME_TextEditor *editor, int x, int y, int clickNum)
is_selection
=
ME_IsSelection
(
editor
);
is_selection
=
ME_IsSelection
(
editor
);
is_shift
=
GetKeyState
(
VK_SHIFT
)
<
0
;
is_shift
=
GetKeyState
(
VK_SHIFT
)
<
0
;
ME_FindPixelPos
(
editor
,
x
,
y
,
&
editor
->
pCursors
[
0
],
&
editor
->
bCaretAtEnd
);
ME_FindPixelPos
(
editor
,
x
,
y
,
&
editor
->
pCursors
[
0
],
&
editor
->
bCaretAtEnd
,
FALSE
);
if
(
x
>=
editor
->
rcFormat
.
left
||
is_shift
)
if
(
x
>=
editor
->
rcFormat
.
left
||
is_shift
)
{
{
...
@@ -1190,7 +1189,7 @@ void ME_MouseMove(ME_TextEditor *editor, int x, int y)
...
@@ -1190,7 +1189,7 @@ void ME_MouseMove(ME_TextEditor *editor, int x, int y)
tmp_cursor
=
editor
->
pCursors
[
0
];
tmp_cursor
=
editor
->
pCursors
[
0
];
/* FIXME: do something with the return value of ME_FindPixelPos */
/* FIXME: do something with the return value of ME_FindPixelPos */
ME_FindPixelPos
(
editor
,
x
,
y
,
&
tmp_cursor
,
&
editor
->
bCaretAtEnd
);
ME_FindPixelPos
(
editor
,
x
,
y
,
&
tmp_cursor
,
&
editor
->
bCaretAtEnd
,
TRUE
);
ME_InvalidateSelection
(
editor
);
ME_InvalidateSelection
(
editor
);
editor
->
pCursors
[
0
]
=
tmp_cursor
;
editor
->
pCursors
[
0
]
=
tmp_cursor
;
...
...
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