[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43420] trunk/blender/source/blender: middle mouse jump scrolling for text window.

Campbell Barton ideasman42 at gmail.com
Mon Jan 16 11:49:07 CET 2012


Revision: 43420
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43420
Author:   campbellbarton
Date:     2012-01-16 10:48:52 +0000 (Mon, 16 Jan 2012)
Log Message:
-----------
middle mouse jump scrolling for text window.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_text/space_text.c
    trunk/blender/source/blender/editors/space_text/text_ops.c
    trunk/blender/source/blender/python/mathutils/mathutils_Matrix.c

Modified: trunk/blender/source/blender/editors/space_text/space_text.c
===================================================================
--- trunk/blender/source/blender/editors/space_text/space_text.c	2012-01-16 10:05:53 UTC (rev 43419)
+++ trunk/blender/source/blender/editors/space_text/space_text.c	2012-01-16 10:48:52 UTC (rev 43420)
@@ -357,9 +357,11 @@
 	
 	WM_keymap_add_item(keymap, "TEXT_OT_overwrite_toggle", INSERTKEY, KM_PRESS, 0, 0);
 
+	WM_keymap_add_item(keymap, "TEXT_OT_scroll_bar", LEFTMOUSE, KM_PRESS, 0, 0);
+	WM_keymap_add_item(keymap, "TEXT_OT_scroll_bar", MIDDLEMOUSE, KM_PRESS, 0, 0);
+
 	WM_keymap_add_item(keymap, "TEXT_OT_scroll", MIDDLEMOUSE, KM_PRESS, 0, 0);
 	WM_keymap_add_item(keymap, "TEXT_OT_scroll", MOUSEPAN, 0, 0, 0);
-	WM_keymap_add_item(keymap, "TEXT_OT_scroll_bar", LEFTMOUSE, KM_PRESS, 0, 0);
 	WM_keymap_add_item(keymap, "TEXT_OT_selection_set", EVT_TWEAK_L, KM_ANY, 0, 0);
 	WM_keymap_add_item(keymap, "TEXT_OT_cursor_set", LEFTMOUSE, KM_PRESS, 0, 0);
 	RNA_boolean_set(WM_keymap_add_item(keymap, "TEXT_OT_selection_set", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "select", 1);

Modified: trunk/blender/source/blender/editors/space_text/text_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_text/text_ops.c	2012-01-16 10:05:53 UTC (rev 43419)
+++ trunk/blender/source/blender/editors/space_text/text_ops.c	2012-01-16 10:48:52 UTC (rev 43420)
@@ -2232,8 +2232,8 @@
 		text_scroll_apply(C, op, event);
 		scroll_exit(C, op);
 		return OPERATOR_FINISHED;
-	}	
-	
+	}
+
 	WM_event_add_modal_handler(C, op);
 	
 	return OPERATOR_RUNNING_MODAL;
@@ -2314,9 +2314,20 @@
 	tsc->scrollbar= 1;
 	tsc->zone= zone;
 	op->customdata= tsc;
-	
 	st->flags|= ST_SCROLL_SELECT;
 
+	/* jump scroll, works in v2d but needs to be added here too :S */
+	if (event->type == MIDDLEMOUSE) {
+		tsc->old[0] = ar->winrct.xmin + (st->txtbar.xmax + st->txtbar.xmin) / 2;
+		tsc->old[1] = ar->winrct.ymin + (st->txtbar.ymax + st->txtbar.ymin) / 2;
+
+		tsc->delta[0] = 0;
+		tsc->delta[1] = 0;
+		tsc->first = 0;
+		tsc->zone= SCROLLHANDLE_BAR;
+		text_scroll_apply(C, op, event);
+	}
+
 	WM_event_add_modal_handler(C, op);
 
 	return OPERATOR_RUNNING_MODAL;

Modified: trunk/blender/source/blender/python/mathutils/mathutils_Matrix.c
===================================================================
--- trunk/blender/source/blender/python/mathutils/mathutils_Matrix.c	2012-01-16 10:05:53 UTC (rev 43419)
+++ trunk/blender/source/blender/python/mathutils/mathutils_Matrix.c	2012-01-16 10:48:52 UTC (rev 43420)
@@ -1939,14 +1939,7 @@
 	             Py_TYPE(m1)->tp_name, Py_TYPE(m2)->tp_name);
 	return NULL;
 }
-static PyObject *Matrix_inv(MatrixObject *self)
-{
-	if (BaseMath_ReadCallback(self) == -1)
-		return NULL;
 
-	return Matrix_invert(self);
-}
-
 /*-----------------PROTOCOL DECLARATIONS--------------------------*/
 static PySequenceMethods Matrix_SeqMethods = {
 	(lenfunc) Matrix_len,						/* sq_length */



More information about the Bf-blender-cvs mailing list