[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [32156] trunk/blender/source/blender/ editors/space_console/console_draw.c: bugfix, console text selection / w wrapped lines now works.

Campbell Barton ideasman42 at gmail.com
Mon Sep 27 18:35:14 CEST 2010


Revision: 32156
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=32156
Author:   campbellbarton
Date:     2010-09-27 18:35:14 +0200 (Mon, 27 Sep 2010)

Log Message:
-----------
bugfix, console text selection /w wrapped lines now works.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_console/console_draw.c

Modified: trunk/blender/source/blender/editors/space_console/console_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_console/console_draw.c	2010-09-27 15:14:58 UTC (rev 32155)
+++ trunk/blender/source/blender/editors/space_console/console_draw.c	2010-09-27 16:35:14 UTC (rev 32156)
@@ -163,16 +163,20 @@
 
 	/* just advance the height */
 	if(cdc->draw==0) {
-		if(cdc->pos_pick) {
-			if((cdc->mval[1] != INT_MAX) && cdc->xy[1] <= cdc->mval[1]) {
-				if((cdc->xy[1]+cdc->lheight >= cdc->mval[1])) {
+		if(cdc->pos_pick && (cdc->mval[1] != INT_MAX)) {
+			if(cdc->xy[1] <= cdc->mval[1]) {
+				if((y_next >= cdc->mval[1])) {
 					int ofs = (int)floor(((float)cdc->mval[0] / (float)cdc->cwidth));
+
+					/* wrap */
+					if(str_len > cdc->console_width)
+						ofs += (cdc->console_width * ((int)((((float)(y_next - cdc->mval[1]) / (float)(y_next-cdc->xy[1])) * tot_lines))));
+	
 					CLAMP(ofs, 0, str_len);
 					*cdc->pos_pick += str_len - ofs;
 				} else
 					*cdc->pos_pick += str_len + 1;
 			}
-
 		}
 
 		cdc->xy[1]= y_next;





More information about the Bf-blender-cvs mailing list