Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
e6b938ef
Unverified
Commit
e6b938ef
authored
May 07, 2018
by
Juan Linietsky
Committed by
GitHub
May 07, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #18219 from AlexHolly/fix-image-blit-blend
blit and blend fix when dst<Vector2
parents
0db4c576
7cfdffcd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
image.cpp
core/image.cpp
+24
-0
No files found.
core/image.cpp
View file @
e6b938ef
...
...
@@ -1628,6 +1628,12 @@ void Image::blit_rect(const Ref<Image> &p_src, const Rect2 &p_src_rect, const Po
ERR_FAIL_COND
(
format
!=
p_src
->
format
);
Rect2i
clipped_src_rect
=
Rect2i
(
0
,
0
,
p_src
->
width
,
p_src
->
height
).
clip
(
p_src_rect
);
if
(
p_dest
.
x
<
0
)
clipped_src_rect
.
position
.
x
=
ABS
(
p_dest
.
x
);
if
(
p_dest
.
y
<
0
)
clipped_src_rect
.
position
.
y
=
ABS
(
p_dest
.
y
);
if
(
clipped_src_rect
.
size
.
x
<=
0
||
clipped_src_rect
.
size
.
y
<=
0
)
return
;
...
...
@@ -1676,6 +1682,12 @@ void Image::blit_rect_mask(const Ref<Image> &p_src, const Ref<Image> &p_mask, co
ERR_FAIL_COND
(
format
!=
p_src
->
format
);
Rect2i
clipped_src_rect
=
Rect2i
(
0
,
0
,
p_src
->
width
,
p_src
->
height
).
clip
(
p_src_rect
);
if
(
p_dest
.
x
<
0
)
clipped_src_rect
.
position
.
x
=
ABS
(
p_dest
.
x
);
if
(
p_dest
.
y
<
0
)
clipped_src_rect
.
position
.
y
=
ABS
(
p_dest
.
y
);
if
(
clipped_src_rect
.
size
.
x
<=
0
||
clipped_src_rect
.
size
.
y
<=
0
)
return
;
...
...
@@ -1727,6 +1739,12 @@ void Image::blend_rect(const Ref<Image> &p_src, const Rect2 &p_src_rect, const P
ERR_FAIL_COND
(
format
!=
p_src
->
format
);
Rect2i
clipped_src_rect
=
Rect2i
(
0
,
0
,
p_src
->
width
,
p_src
->
height
).
clip
(
p_src_rect
);
if
(
p_dest
.
x
<
0
)
clipped_src_rect
.
position
.
x
=
ABS
(
p_dest
.
x
);
if
(
p_dest
.
y
<
0
)
clipped_src_rect
.
position
.
y
=
ABS
(
p_dest
.
y
);
if
(
clipped_src_rect
.
size
.
x
<=
0
||
clipped_src_rect
.
size
.
y
<=
0
)
return
;
...
...
@@ -1775,6 +1793,12 @@ void Image::blend_rect_mask(const Ref<Image> &p_src, const Ref<Image> &p_mask, c
ERR_FAIL_COND
(
format
!=
p_src
->
format
);
Rect2i
clipped_src_rect
=
Rect2i
(
0
,
0
,
p_src
->
width
,
p_src
->
height
).
clip
(
p_src_rect
);
if
(
p_dest
.
x
<
0
)
clipped_src_rect
.
position
.
x
=
ABS
(
p_dest
.
x
);
if
(
p_dest
.
y
<
0
)
clipped_src_rect
.
position
.
y
=
ABS
(
p_dest
.
y
);
if
(
clipped_src_rect
.
size
.
x
<=
0
||
clipped_src_rect
.
size
.
y
<=
0
)
return
;
...
...
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