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
5dc422d4
Commit
5dc422d4
authored
Oct 07, 2020
by
Huw Davies
Committed by
Alexandre Julliard
Oct 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Simplify FindPixelPos().
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
eb9556bd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
17 deletions
+16
-17
caret.c
dlls/riched20/caret.c
+16
-17
No files found.
dlls/riched20/caret.c
View file @
5dc422d4
...
...
@@ -1011,6 +1011,7 @@ static BOOL ME_FindPixelPos(ME_TextEditor *editor, int x, int y,
ME_Cursor
*
result
,
BOOL
*
is_eol
,
BOOL
final_eop
)
{
ME_DisplayItem
*
p
=
editor
->
pBuffer
->
pFirst
->
member
.
para
.
next_para
;
ME_DisplayItem
*
row
=
NULL
;
BOOL
isExact
=
TRUE
;
x
-=
editor
->
rcFormat
.
left
;
...
...
@@ -1022,42 +1023,40 @@ static BOOL ME_FindPixelPos(ME_TextEditor *editor, int x, int y,
/* find paragraph */
for
(;
p
!=
editor
->
pBuffer
->
pLast
;
p
=
p
->
member
.
para
.
next_para
)
{
assert
(
p
->
type
==
diParagraph
);
if
(
y
<
p
->
member
.
para
.
pt
.
y
+
p
->
member
.
para
.
nHeight
)
{
if
(
p
->
member
.
para
.
nFlags
&
MEPF_ROWSTART
)
p
=
ME_FindPixelPosInTableRow
(
x
,
y
,
p
);
y
-=
p
->
member
.
para
.
pt
.
y
;
p
=
ME_FindItemFwd
(
p
,
diStartRow
);
row
=
ME_FindItemFwd
(
p
,
diStartRow
);
break
;
}
else
if
(
p
->
member
.
para
.
nFlags
&
MEPF_ROWSTART
)
{
}
else
if
(
p
->
member
.
para
.
nFlags
&
MEPF_ROWSTART
)
{
p
=
ME_GetTableRowEnd
(
p
);
}
}
/* find row */
for
(;
p
!=
editor
->
pBuffer
->
pLast
;
)
while
(
row
)
{
ME_DisplayItem
*
pp
;
assert
(
p
->
type
==
diStartRow
);
if
(
y
<
p
->
member
.
row
.
pt
.
y
+
p
->
member
.
row
.
nHeight
)
break
;
pp
=
ME_FindItemFwd
(
p
,
diStartRow
);
if
(
!
pp
)
break
;
p
=
pp
;
ME_DisplayItem
*
next_row
;
if
(
y
<
row
->
member
.
row
.
pt
.
y
+
row
->
member
.
row
.
nHeight
)
break
;
next_row
=
ME_FindItemFwd
(
row
,
diStartRow
);
if
(
!
next_row
)
break
;
row
=
next_row
;
}
if
(
p
==
editor
->
pBuffer
->
pLast
&&
!
final_eop
)
if
(
!
row
&&
!
final_eop
)
{
/* 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
* determine the offset closest to the pixel position. */
isExact
=
FALSE
;
p
=
ME_FindItemBack
(
p
,
diStartRow
);
if
(
!
p
)
p
=
editor
->
pBuffer
->
pLast
;
row
=
ME_FindItemBack
(
p
,
diStartRow
);
}
assert
(
p
->
type
==
diStartRow
||
p
==
editor
->
pBuffer
->
pLast
);
if
(
p
->
type
==
diStartRow
)
return
ME_FindRunInRow
(
editor
,
p
,
x
,
result
,
is_eol
)
&&
isExact
;
if
(
row
)
return
ME_FindRunInRow
(
editor
,
row
,
x
,
result
,
is_eol
)
&&
isExact
;
ME_SetCursorToEnd
(
editor
,
result
,
TRUE
);
return
FALSE
;
...
...
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