Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
f70eb806
Commit
f70eb806
authored
Dec 04, 2008
by
Jason Rumney
Browse files
(w32font_draw): Initialize orig_clip before getting it, and delete it
when finished.
parent
1cc54663
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
src/w32font.c
src/w32font.c
+13
-7
No files found.
src/w32font.c
View file @
f70eb806
...
...
@@ -530,18 +530,23 @@ w32font_draw (s, from, to, x, y, with_background)
int
from
,
to
,
x
,
y
,
with_background
;
{
UINT
options
;
HRGN
orig_clip
;
HRGN
orig_clip
=
NULL
;
struct
w32font_info
*
w32font
=
(
struct
w32font_info
*
)
s
->
font
;
options
=
w32font
->
glyph_idx
;
/* Save clip region for later restoration. */
GetClipRgn
(
s
->
hdc
,
orig_clip
);
if
(
s
->
num_clips
>
0
)
{
HRGN
new_clip
=
CreateRectRgnIndirect
(
s
->
clip
);
/* Save clip region for later restoration. */
orig_clip
=
CreateRectRgn
(
0
,
0
,
0
,
0
);
if
(
!
GetClipRgn
(
s
->
hdc
,
orig_clip
))
{
DeleteObject
(
orig_clip
);
orig_clip
=
NULL
;
}
if
(
s
->
num_clips
>
1
)
{
HRGN
clip2
=
CreateRectRgnIndirect
(
s
->
clip
+
1
);
...
...
@@ -585,9 +590,10 @@ w32font_draw (s, from, to, x, y, with_background)
/* Restore clip region. */
if
(
s
->
num_clips
>
0
)
{
SelectClipRgn
(
s
->
hdc
,
orig_clip
);
}
SelectClipRgn
(
s
->
hdc
,
orig_clip
);
if
(
orig_clip
)
DeleteObject
(
orig_clip
);
}
/* w32 implementation of free_entity for font backend.
...
...
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