Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2006-08-27 17:29:00 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2006-08-27 17:29:00 +0400
commitb39f4b788dc9c5ccc9430b02852cbc1cbe56eca1 (patch)
tree7a1c91c3d4235db02b231ab5f504b31c2c0e4f15 /source/blender/imbuf/intern/rectop.c
parent84205fe0e0bfc524b8fd9ba09aedbf98b0b9457b (diff)
Texturepaint now supports all the imagepaint brush settings, with the
exception of the clone tool. One level undo for image- and texturepaint, only storing those tiles that changed. Test to improve texturepaint performance using glTexSubImage2D, only enabled with 2^n sized textures and mipmapping off. Painting a 2048x2048 texture is then pretty smooth here, as long as the geometry is not too complex.
Diffstat (limited to 'source/blender/imbuf/intern/rectop.c')
-rw-r--r--source/blender/imbuf/intern/rectop.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/source/blender/imbuf/intern/rectop.c b/source/blender/imbuf/intern/rectop.c
index 59fcd3e25e2..b56c0df0105 100644
--- a/source/blender/imbuf/intern/rectop.c
+++ b/source/blender/imbuf/intern/rectop.c
@@ -250,23 +250,23 @@ void IMB_rectclip(struct ImBuf *dbuf, struct ImBuf *sbuf, int *destx,
if (dbuf == NULL) return;
if (*destx < 0) {
- *srcx -= *destx ;
- *width += *destx ;
+ *srcx -= *destx;
+ *width += *destx;
*destx = 0;
}
if (*srcx < 0) {
- *destx -= *srcx ;
- *width += *destx ;
+ *destx -= *srcx;
+ *width += *destx;
*srcx = 0;
}
if (*desty < 0) {
- *srcy -= *desty ;
- *height += *desty ;
+ *srcy -= *desty;
+ *height += *desty;
*desty = 0;
}
if (*srcy < 0) {
- *desty -= *srcy ;
- *height += *desty ;
+ *desty -= *srcy;
+ *height += *desty;
*srcy = 0;
}
@@ -281,6 +281,11 @@ void IMB_rectclip(struct ImBuf *dbuf, struct ImBuf *sbuf, int *destx,
tmp = sbuf->y - *srcy;
if (*height > tmp) *height = tmp;
}
+
+ if ((*height <= 0) || (*width <= 0)) {
+ *width = 0;
+ *height = 0;
+ }
}
/* copy and blend */