示例#1
0
 void Resizer_Begin(Gwen.Control.Base sender, EventArgs arguments)
 {
     if (m_selectionList.Resizer.IsHoveringResizers() &&
         m_selectionList.Selection.Count == 1 &&
         m_selectionList.Selection[0].IsResizable())
     {
         m_resizeAction = new Action_Resize(m_selectionList.Selection[0]);
     }
 }
示例#2
0
 void Resizer_End(Gwen.Control.Base sender, EventArgs arguments)
 {
     if (m_resizeAction != null)
     {
         m_resizeAction.EndResizing(m_selectionList.Resizer.Bounds);
         ActionQueue.Instance.PushAction(m_resizeAction);
         m_resizeAction = null;
         SceneEdEventNotifier.Instance.Emit_RefreshScene(RefreshSceneOpt.Refresh_Rendering | RefreshSceneOpt.Refresh_Properties);
     }
 }
示例#3
0
        public static void OnCommand(Command cmd)
        {
            switch (cmd)
            {
            case Command.ResizeControlToResourceSize:
                if (SceneEd.Instance.Selection.Selection.Count == 1)
                {
                    Node target = SceneEd.Instance.Selection.Selection[0];
                    if (target.GetExpectedResourceSize() != ucore.Const.ZERO_SIZE)
                    {
                        Action_Resize resizeAction = new Action_Resize(target);
                        Rectangle     bound        = new Rectangle(target.GetWorldPosition(), target.GetExpectedResourceSize());
                        resizeAction.EndResizing(bound);
                        ActionQueue.Instance.PushAction(resizeAction);
                        SceneEdEventNotifier.Instance.Emit_RefreshScene(RefreshSceneOpt.Refresh_All);
                    }
                }
                break;

            default:
                break;
            }
        }