Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
cfeb4358
Commit
cfeb4358
authored
Aug 19, 2019
by
Huw Davies
Committed by
Alexandre Julliard
Aug 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Use PatBlt() instead of FillRect() to paint the background area.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6f1cc1f3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
26 deletions
+28
-26
editor.c
dlls/riched20/editor.c
+11
-7
paint.c
dlls/riched20/paint.c
+17
-19
No files found.
dlls/riched20/editor.c
View file @
cfeb4358
...
...
@@ -4983,42 +4983,46 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
{
case
WM_PAINT
:
{
HDC
h
DC
;
HDC
h
dc
;
RECT
rc
;
PAINTSTRUCT
ps
;
HBRUSH
old_brush
;
update_caret
(
editor
);
h
DC
=
BeginPaint
(
editor
->
hWnd
,
&
ps
);
h
dc
=
BeginPaint
(
editor
->
hWnd
,
&
ps
);
if
(
!
editor
->
bEmulateVersion10
||
(
editor
->
nEventMask
&
ENM_UPDATE
))
ME_SendOldNotify
(
editor
,
EN_UPDATE
);
old_brush
=
SelectObject
(
hdc
,
editor
->
hbrBackground
);
/* Erase area outside of the formatting rectangle */
if
(
ps
.
rcPaint
.
top
<
editor
->
rcFormat
.
top
)
{
rc
=
ps
.
rcPaint
;
rc
.
bottom
=
editor
->
rcFormat
.
top
;
FillRect
(
hDC
,
&
rc
,
editor
->
hbrBackground
);
PatBlt
(
hdc
,
rc
.
left
,
rc
.
top
,
rc
.
right
-
rc
.
left
,
rc
.
bottom
-
rc
.
top
,
PATCOPY
);
ps
.
rcPaint
.
top
=
editor
->
rcFormat
.
top
;
}
if
(
ps
.
rcPaint
.
bottom
>
editor
->
rcFormat
.
bottom
)
{
rc
=
ps
.
rcPaint
;
rc
.
top
=
editor
->
rcFormat
.
bottom
;
FillRect
(
hDC
,
&
rc
,
editor
->
hbrBackground
);
PatBlt
(
hdc
,
rc
.
left
,
rc
.
top
,
rc
.
right
-
rc
.
left
,
rc
.
bottom
-
rc
.
top
,
PATCOPY
);
ps
.
rcPaint
.
bottom
=
editor
->
rcFormat
.
bottom
;
}
if
(
ps
.
rcPaint
.
left
<
editor
->
rcFormat
.
left
)
{
rc
=
ps
.
rcPaint
;
rc
.
right
=
editor
->
rcFormat
.
left
;
FillRect
(
hDC
,
&
rc
,
editor
->
hbrBackground
);
PatBlt
(
hdc
,
rc
.
left
,
rc
.
top
,
rc
.
right
-
rc
.
left
,
rc
.
bottom
-
rc
.
top
,
PATCOPY
);
ps
.
rcPaint
.
left
=
editor
->
rcFormat
.
left
;
}
if
(
ps
.
rcPaint
.
right
>
editor
->
rcFormat
.
right
)
{
rc
=
ps
.
rcPaint
;
rc
.
left
=
editor
->
rcFormat
.
right
;
FillRect
(
hDC
,
&
rc
,
editor
->
hbrBackground
);
PatBlt
(
hdc
,
rc
.
left
,
rc
.
top
,
rc
.
right
-
rc
.
left
,
rc
.
bottom
-
rc
.
top
,
PATCOPY
);
ps
.
rcPaint
.
right
=
editor
->
rcFormat
.
right
;
}
ME_PaintContent
(
editor
,
hDC
,
&
ps
.
rcPaint
);
ME_PaintContent
(
editor
,
hdc
,
&
ps
.
rcPaint
);
SelectObject
(
hdc
,
old_brush
);
EndPaint
(
editor
->
hWnd
,
&
ps
);
return
0
;
}
...
...
dlls/riched20/paint.c
View file @
cfeb4358
...
...
@@ -43,6 +43,7 @@ void ME_PaintContent(ME_TextEditor *editor, HDC hDC, const RECT *rcUpdate)
ME_InitContext
(
&
c
,
editor
,
hDC
);
SetBkMode
(
hDC
,
TRANSPARENT
);
item
=
editor
->
pBuffer
->
pFirst
->
next
;
/* This context point is an offset for the paragraph positions stored
* during wrapping. It shouldn't be modified during painting. */
...
...
@@ -86,7 +87,7 @@ void ME_PaintContent(ME_TextEditor *editor, HDC hDC, const RECT *rcUpdate)
IntersectRect
(
&
rc
,
&
rc
,
rcUpdate
);
if
(
!
IsRectEmpty
(
&
rc
))
FillRect
(
hDC
,
&
rc
,
c
.
editor
->
hbrBackground
);
PatBlt
(
hDC
,
rc
.
left
,
rc
.
top
,
rc
.
right
-
rc
.
left
,
rc
.
bottom
-
rc
.
top
,
PATCOPY
);
}
if
(
editor
->
nTotalLength
!=
editor
->
nLastTotalLength
||
editor
->
nTotalWidth
!=
editor
->
nLastTotalWidth
)
...
...
@@ -597,7 +598,7 @@ static void ME_DrawParaDecoration(ME_Context* c, ME_Paragraph* para, int y, RECT
rc
.
top
=
y
;
bounds
->
top
=
ME_twips2pointsY
(
c
,
para
->
fmt
.
dySpaceBefore
);
rc
.
bottom
=
y
+
bounds
->
top
+
top_border
;
FillRect
(
c
->
hDC
,
&
rc
,
c
->
editor
->
hbrBackground
);
PatBlt
(
c
->
hDC
,
rc
.
left
,
rc
.
top
,
rc
.
right
-
rc
.
left
,
rc
.
bottom
-
rc
.
top
,
PATCOPY
);
}
if
(
para
->
fmt
.
dwMask
&
PFM_SPACEAFTER
)
...
...
@@ -607,7 +608,7 @@ static void ME_DrawParaDecoration(ME_Context* c, ME_Paragraph* para, int y, RECT
rc
.
bottom
=
y
+
para
->
nHeight
;
bounds
->
bottom
=
ME_twips2pointsY
(
c
,
para
->
fmt
.
dySpaceAfter
);
rc
.
top
=
rc
.
bottom
-
bounds
->
bottom
-
bottom_border
;
FillRect
(
c
->
hDC
,
&
rc
,
c
->
editor
->
hbrBackground
);
PatBlt
(
c
->
hDC
,
rc
.
left
,
rc
.
top
,
rc
.
right
-
rc
.
left
,
rc
.
bottom
-
rc
.
top
,
PATCOPY
);
}
/* Native richedit doesn't support paragraph borders in v1.0 - 4.1,
...
...
@@ -646,7 +647,7 @@ static void ME_DrawParaDecoration(ME_Context* c, ME_Paragraph* para, int y, RECT
rc
.
right
=
rc
.
left
+
border_width
;
rc
.
top
=
y
+
bounds
->
top
;
rc
.
bottom
=
y
+
para
->
nHeight
-
bounds
->
bottom
;
FillRect
(
c
->
hDC
,
&
rc
,
c
->
editor
->
hbrBackground
);
PatBlt
(
c
->
hDC
,
rc
.
left
,
rc
.
top
,
rc
.
right
-
rc
.
left
,
rc
.
bottom
-
rc
.
top
,
PATCOPY
);
MoveToEx
(
c
->
hDC
,
c
->
pt
.
x
+
pen_width
+
1
,
y
+
bounds
->
top
+
DD
(
4
),
NULL
);
LineTo
(
c
->
hDC
,
c
->
pt
.
x
+
pen_width
+
1
,
y
+
para
->
nHeight
-
bounds
->
bottom
-
DD
(
8
));
}
...
...
@@ -661,7 +662,7 @@ static void ME_DrawParaDecoration(ME_Context* c, ME_Paragraph* para, int y, RECT
rc
.
right
=
rc
.
left
+
pen_width
;
rc
.
top
=
y
+
bounds
->
top
;
rc
.
bottom
=
y
+
para
->
nHeight
-
bounds
->
bottom
;
FillRect
(
c
->
hDC
,
&
rc
,
c
->
editor
->
hbrBackground
);
PatBlt
(
c
->
hDC
,
rc
.
left
,
rc
.
top
,
rc
.
right
-
rc
.
left
,
rc
.
bottom
-
rc
.
top
,
PATCOPY
);
MoveToEx
(
c
->
hDC
,
rightEdge
-
1
-
pen_width
-
1
,
y
+
bounds
->
top
+
DD
(
4
),
NULL
);
LineTo
(
c
->
hDC
,
rightEdge
-
1
-
pen_width
-
1
,
y
+
para
->
nHeight
-
bounds
->
bottom
-
DD
(
8
));
}
...
...
@@ -725,9 +726,8 @@ static void ME_DrawTableBorders(ME_Context *c, ME_DisplayItem *paragraph)
rc
.
top
=
top
+
width
;
width
=
cell
->
yTextOffset
-
width
;
rc
.
bottom
=
rc
.
top
+
width
;
if
(
width
)
{
FillRect
(
c
->
hDC
,
&
rc
,
c
->
editor
->
hbrBackground
);
}
if
(
width
)
PatBlt
(
c
->
hDC
,
rc
.
left
,
rc
.
top
,
rc
.
right
-
rc
.
left
,
rc
.
bottom
-
rc
.
top
,
PATCOPY
);
}
/* Draw cell borders.
* The order borders are draw in is left, top, bottom, right in order
...
...
@@ -966,18 +966,18 @@ static void ME_DrawParagraph(ME_Context *c, ME_DisplayItem *paragraph)
rc
.
bottom
=
y
+
p
->
member
.
row
.
nHeight
;
}
visible
=
RectVisible
(
c
->
hDC
,
&
rc
);
if
(
visible
)
{
FillRect
(
c
->
hDC
,
&
rc
,
c
->
editor
->
hbrBackground
);
}
if
(
visible
)
PatBlt
(
c
->
hDC
,
rc
.
left
,
rc
.
top
,
rc
.
right
-
rc
.
left
,
rc
.
bottom
-
rc
.
top
,
PATCOPY
);
if
(
bounds
.
right
)
{
/* If scrolled to the right past the end of the text, then
* there may be space to the right of the paragraph border. */
RECT
rcAfterBrdr
=
rc
;
rcAfterBrdr
.
left
=
rc
.
right
+
bounds
.
right
;
rcAfterBrdr
.
right
=
c
->
rcView
.
right
;
if
(
RectVisible
(
c
->
hDC
,
&
rcAfterBrdr
))
FillRect
(
c
->
hDC
,
&
rcAfterBrdr
,
c
->
editor
->
hbrBackground
);
RECT
after_bdr
=
rc
;
after_bdr
.
left
=
rc
.
right
+
bounds
.
right
;
after_bdr
.
right
=
c
->
rcView
.
right
;
if
(
RectVisible
(
c
->
hDC
,
&
after_bdr
))
PatBlt
(
c
->
hDC
,
after_bdr
.
left
,
after_bdr
.
top
,
after_bdr
.
right
-
after_bdr
.
left
,
after_bdr
.
bottom
-
after_bdr
.
top
,
PATCOPY
);
}
if
(
me_debug
)
{
...
...
@@ -1026,9 +1026,7 @@ static void ME_DrawParagraph(ME_Context *c, ME_DisplayItem *paragraph)
rc
.
top
=
c
->
pt
.
y
+
para
->
pt
.
y
+
para
->
nHeight
;
rc
.
bottom
=
c
->
pt
.
y
+
p
->
member
.
cell
.
pt
.
y
+
p
->
member
.
cell
.
nHeight
;
if
(
RectVisible
(
c
->
hDC
,
&
rc
))
{
FillRect
(
c
->
hDC
,
&
rc
,
c
->
editor
->
hbrBackground
);
}
PatBlt
(
c
->
hDC
,
rc
.
left
,
rc
.
top
,
rc
.
right
-
rc
.
left
,
rc
.
bottom
-
rc
.
top
,
PATCOPY
);
break
;
default:
break
;
...
...
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