Browse Source

Minor fix for consistent behaviour immediately after viewport setup.

Yao Wei Tjong 姚伟忠 12 years ago
parent
commit
d1455cba3f
1 changed files with 2 additions and 1 deletions
  1. 2 1
      Bin/Data/Scripts/Editor/EditorToolBar.as

+ 2 - 1
Bin/Data/Scripts/Editor/EditorToolBar.as

@@ -365,7 +365,8 @@ void ToolBarFillModeSolid(StringHash eventType, VariantMap& eventData)
 void ToolBarSetViewportMode(StringHash eventType, VariantMap& eventData)
 {
     DropDownList@ dropDown = eventData["Element"].GetUIElement();
-    UIElement@ selected = dropDown.GetItems()[dropDown.selection];
+    UIElement@ selected = dropDown.selectedItem;
+    dropDown.focus = false;     // Lose the focus so the RMB dragging, immediately followed after changing viewport setup, behaves as expected
     uint mode = selected.vars[VIEW_MODE].GetUInt();
     SetViewportMode(mode);
 }