Fix #28432: Scrolling lists respond incorrectly if mouse is not moved
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 30 Sep 2011 15:42:04 +0000 (15:42 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 30 Sep 2011 15:42:04 +0000 (15:42 +0000)
Copy hardmin for LISTROW and ROW buttons when updating button
from old block due to list item index is stored in this value.

source/blender/editors/interface/interface.c

index 878b280118d507d1ae348691deaba74ce97cd14c..a3ae39c844060d1f71be88263be34a4762ec7d51 100644 (file)
@@ -678,6 +678,11 @@ static int ui_but_update_from_old_block(const bContext *C, uiBlock *block, uiBut
                                        SWAP(void *, oldbut->func_argN, but->func_argN)
                                }
                                
+                               /* copy hardmin for list rows to prevent 'sticking' highlight to mouse position
+                                  when scrolling without moving mouse (see [#28432]) */
+                               if(ELEM(oldbut->type, ROW, LISTROW))
+                                       oldbut->hardmax= but->hardmax;
+                               
                                ui_but_update_linklines(block, oldbut, but);
                                
                                BLI_remlink(&block->buttons, but);