aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2019-08-03 11:32:51 +0200
committerGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2019-08-03 11:32:51 +0200
commit8c4ff976c49b425b594ec0258df3dacbcf605e54 (patch)
treeaa12e1565375e92cbcc10418829a3683312138ea
parentea1ad7bdf737c4aef17e7daee5512842e108e96d (diff)
downloadd2tk-8c4ff976c49b425b594ec0258df3dacbcf605e54.zip
d2tk-8c4ff976c49b425b594ec0258df3dacbcf605e54.tar.gz
d2tk-8c4ff976c49b425b594ec0258df3dacbcf605e54.tar.bz2
d2tk-8c4ff976c49b425b594ec0258df3dacbcf605e54.tar.xz
core: fix cliping in bitmap routines.
-rw-r--r--VERSION2
-rw-r--r--src/core.c16
2 files changed, 17 insertions, 1 deletions
diff --git a/VERSION b/VERSION
index 509a32c..fd1dfe4 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.761
+0.1.763
diff --git a/src/core.c b/src/core.c
index 7910dd1..33506c8 100644
--- a/src/core.c
+++ b/src/core.c
@@ -404,17 +404,33 @@ _d2tk_clip_clip(d2tk_core_t *core, d2tk_clip_t *dst, const d2tk_clip_t *src)
{
dst->x0 = 0;
}
+ if(dst->x1 < 0)
+ {
+ dst->x1 = 0;
+ }
if(dst->y0 < 0)
{
dst->y0 = 0;
}
+ if(dst->y1 < 0)
+ {
+ dst->y1 = 0;
+ }
+ if(dst->x0 >= core->w)
+ {
+ dst->x0 = core->w - 1;
+ }
if(dst->x1 >= core->w)
{
dst->x1 = core->w - 1;
}
+ if(dst->y0 >= core->h)
+ {
+ dst->y0 = core->h - 1;
+ }
if(dst->y1 >= core->h)
{
dst->y1 = core->h - 1;