[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [34860] trunk/blender/source/blender: fix for own error with image info display, also dont draw if the mouse is outside the image.

Campbell Barton ideasman42 at gmail.com
Tue Feb 15 05:06:20 CET 2011


Revision: 34860
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=34860
Author:   campbellbarton
Date:     2011-02-15 04:06:13 +0000 (Tue, 15 Feb 2011)
Log Message:
-----------
fix for own error with image info display, also dont draw if the mouse is outside the image.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_image/image_draw.c
    trunk/blender/source/blender/editors/space_image/image_ops.c
    trunk/blender/source/blender/python/intern/bpy_driver.h

Modified: trunk/blender/source/blender/editors/space_image/image_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_image/image_draw.c	2011-02-15 03:20:12 UTC (rev 34859)
+++ trunk/blender/source/blender/editors/space_image/image_draw.c	2011-02-15 04:06:13 UTC (rev 34860)
@@ -132,23 +132,23 @@
 	char str[256];
 	int ofs= 0;
 
-	ofs += BLI_snprintf(str, sizeof(str)-ofs, "X: %4d Y: %4d ", x, y);
+	ofs += BLI_snprintf(str + ofs, sizeof(str)-ofs, "X: %4d Y: %4d ", x, y);
 	if(cp)
-		ofs+= BLI_snprintf(str, sizeof(str)-ofs, "| R: %3d G: %3d B: %3d A: %3d ", cp[0], cp[1], cp[2], cp[3]);
+		ofs+= BLI_snprintf(str + ofs, sizeof(str)-ofs, "| R: %3d G: %3d B: %3d A: %3d ", cp[0], cp[1], cp[2], cp[3]);
 
 	if(fp) {
 		if(channels==4)
-			ofs+= BLI_snprintf(str, sizeof(str)-ofs, "| R: %.3f G: %.3f B: %.3f A: %.3f ", fp[0], fp[1], fp[2], fp[3]);
+			ofs+= BLI_snprintf(str + ofs, sizeof(str)-ofs, "| R: %.3f G: %.3f B: %.3f A: %.3f ", fp[0], fp[1], fp[2], fp[3]);
 		else if(channels==1)
-			ofs+= BLI_snprintf(str, sizeof(str)-ofs, "| Val: %.3f ", fp[0]);
+			ofs+= BLI_snprintf(str + ofs, sizeof(str)-ofs, "| Val: %.3f ", fp[0]);
 		else if(channels==3)
-			ofs+= BLI_snprintf(str, sizeof(str)-ofs, "| R: %.3f G: %.3f B: %.3f ", fp[0], fp[1], fp[2]);
+			ofs+= BLI_snprintf(str + ofs, sizeof(str)-ofs, "| R: %.3f G: %.3f B: %.3f ", fp[0], fp[1], fp[2]);
 	}
 
 	if(zp)
-		ofs+= BLI_snprintf(str, sizeof(str)-ofs, "| Z: %.4f ", 0.5+0.5*(((float)*zp)/(float)0x7fffffff));
+		ofs+= BLI_snprintf(str + ofs, sizeof(str)-ofs, "| Z: %.4f ", 0.5+0.5*(((float)*zp)/(float)0x7fffffff));
 	if(zpf)
-		ofs+= BLI_snprintf(str, sizeof(str)-ofs, "| Z: %.3f ", *zpf);
+		ofs+= BLI_snprintf(str + ofs, sizeof(str)-ofs, "| Z: %.3f ", *zpf);
 	(void)ofs;
 
 	glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);

Modified: trunk/blender/source/blender/editors/space_image/image_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_image/image_ops.c	2011-02-15 03:20:12 UTC (rev 34859)
+++ trunk/blender/source/blender/editors/space_image/image_ops.c	2011-02-15 04:06:13 UTC (rev 34860)
@@ -1529,9 +1529,9 @@
 static void sample_draw(const bContext *UNUSED(C), ARegion *ar, void *arg_info)
 {
 	ImageSampleInfo *info= arg_info;
-
-	draw_image_info(ar, info->channels, info->x, info->y, info->colp,
-		info->colfp, info->zp, info->zfp);
+	if(info->draw) {
+		draw_image_info(ar, info->channels, info->x, info->y, info->colp, info->colfp, info->zp, info->zfp);
+	}
 }
 
 static void sample_apply(bContext *C, wmOperator *op, wmEvent *event)

Modified: trunk/blender/source/blender/python/intern/bpy_driver.h
===================================================================
--- trunk/blender/source/blender/python/intern/bpy_driver.h	2011-02-15 03:20:12 UTC (rev 34859)
+++ trunk/blender/source/blender/python/intern/bpy_driver.h	2011-02-15 04:06:13 UTC (rev 34860)
@@ -24,6 +24,8 @@
 #ifndef BPY_DRIVER_H
 #define BPY_DRIVER_H
 
+struct ChannelDriver;
+
 int bpy_pydriver_create_dict(void);
 extern PyObject *bpy_pydriver_Dict;
 




More information about the Bf-blender-cvs mailing list