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
9de83579
Commit
9de83579
authored
Jul 19, 2010
by
Dylan Smith
Committed by
Alexandre Julliard
Jul 20, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wordpad: Avoid filling overlapping rectangles in print preview.
This reduces the amount of flicker seen from redrawing the window.
parent
0cd3ee3d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
13 deletions
+35
-13
print.c
programs/wordpad/print.c
+35
-13
No files found.
programs/wordpad/print.c
View file @
9de83579
...
...
@@ -845,33 +845,46 @@ static void update_preview_buttons(HWND hMainWnd)
static
LRESULT
print_preview
(
HWND
hwndPreview
)
{
HPEN
hPen
,
oldPen
;
HDC
hdc
;
HRGN
back_rgn
,
excl_rgn
;
RECT
window
,
background
;
PAINTSTRUCT
ps
;
int
x
,
y
;
hdc
=
BeginPaint
(
hwndPreview
,
&
ps
);
GetClientRect
(
hwndPreview
,
&
window
);
FillRect
(
hdc
,
&
window
,
GetStockObject
(
GRAY_BRUSH
));
back_rgn
=
CreateRectRgnIndirect
(
&
window
);
x
=
preview
.
spacing
.
cx
-
GetScrollPos
(
hwndPreview
,
SB_HORZ
);
y
=
preview
.
spacing
.
cy
-
GetScrollPos
(
hwndPreview
,
SB_VERT
);
/* draw page outlines */
hPen
=
CreatePen
(
PS_SOLID
|
PS_INSIDEFRAME
,
2
,
RGB
(
0
,
0
,
0
));
oldPen
=
SelectObject
(
hdc
,
hPen
);
background
.
left
=
x
-
2
;
background
.
right
=
background
.
left
+
preview
.
bmScaledSize
.
cx
+
4
;
background
.
right
=
x
+
preview
.
bmScaledSize
.
cx
+
2
;
background
.
top
=
y
-
2
;
background
.
bottom
=
background
.
top
+
preview
.
bmScaledSize
.
cy
+
4
;
FillRect
(
hdc
,
&
background
,
GetStockObject
(
BLACK_BRUSH
));
background
.
bottom
=
y
+
preview
.
bmScaledSize
.
cy
+
2
;
Rectangle
(
hdc
,
background
.
left
,
background
.
top
,
background
.
right
,
background
.
bottom
);
excl_rgn
=
CreateRectRgnIndirect
(
&
background
);
CombineRgn
(
back_rgn
,
back_rgn
,
excl_rgn
,
RGN_DIFF
);
if
(
preview
.
pages_shown
>
1
)
{
background
.
left
+=
preview
.
bmScaledSize
.
cx
+
preview
.
spacing
.
cx
;
background
.
right
+=
preview
.
bmScaledSize
.
cx
+
preview
.
spacing
.
cx
;
FillRect
(
hdc
,
&
background
,
GetStockObject
(
BLACK_BRUSH
));
Rectangle
(
hdc
,
background
.
left
,
background
.
top
,
background
.
right
,
background
.
bottom
);
SetRectRgn
(
excl_rgn
,
background
.
left
,
background
.
top
,
background
.
right
,
background
.
bottom
);
CombineRgn
(
back_rgn
,
back_rgn
,
excl_rgn
,
RGN_DIFF
);
}
SelectObject
(
hdc
,
oldPen
);
DeleteObject
(
hPen
);
FillRgn
(
hdc
,
back_rgn
,
GetStockObject
(
GRAY_BRUSH
));
DeleteObject
(
excl_rgn
);
DeleteObject
(
back_rgn
);
StretchBlt
(
hdc
,
x
,
y
,
preview
.
bmScaledSize
.
cx
,
preview
.
bmScaledSize
.
cy
,
preview
.
hdc
,
0
,
0
,
preview
.
bmSize
.
cx
,
preview
.
bmSize
.
cy
,
SRCCOPY
);
...
...
@@ -880,12 +893,21 @@ static LRESULT print_preview(HWND hwndPreview)
if
(
preview
.
pages_shown
>
1
)
{
x
+=
preview
.
spacing
.
cx
+
preview
.
bmScaledSize
.
cx
;
StretchBlt
(
hdc
,
x
,
y
,
preview
.
bmScaledSize
.
cx
,
preview
.
bmScaledSize
.
cy
,
preview
.
hdc2
,
0
,
0
,
preview
.
bmSize
.
cx
,
preview
.
bmSize
.
cy
,
SRCCOPY
);
if
(
!
is_last_preview_page
(
preview
.
page
))
{
x
+=
preview
.
spacing
.
cx
+
preview
.
bmScaledSize
.
cx
;
StretchBlt
(
hdc
,
x
,
y
,
preview
.
bmScaledSize
.
cx
,
preview
.
bmScaledSize
.
cy
,
preview
.
hdc2
,
0
,
0
,
preview
.
bmSize
.
cx
,
preview
.
bmSize
.
cy
,
SRCCOPY
);
if
(
!
is_last_preview_page
(
preview
.
page
))
draw_margin_lines
(
hdc
,
x
,
y
,
preview
.
zoomratio
);
}
else
{
background
.
left
+=
2
;
background
.
right
-=
2
;
background
.
top
+=
2
;
background
.
bottom
-=
2
;
FillRect
(
hdc
,
&
background
,
GetStockObject
(
WHITE_BRUSH
));
}
}
preview
.
window
=
window
;
...
...
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