批量圖形操作,合併Undo 原

因爲有好幾個同學問到如何將多個圖形操作步驟合併成一個Undo,所以就增加了比較實用的 combineRegen 函數。

  • iOS 應用例(GiViewHelper *hlp)

     [hlp combineRegen:^{
         hlp.command = @"line{'points':[10,10, 20,20, 20,10, 30,20]}";
         hlp.command = @"lines{'points':[10,10, 20,20, 20,10, 30,20]}";
     }];
    
  • Android 應用例(IViewHelper hlp)

     hlp.combineRegen(new Runnable() {
         @Override
         public void run() {
             hlp.setCommand("line{'points':[10,10, 20,20, 20,10, 30,20]}");
             hlp.setCommand("lines{'points':[10,10, 20,20, 20,10, 30,20]}");
         }
     });
    
  • C# 應用例(WPFViewHelper hlp)

     hlp.CombineRegen(delegate()
     {
         hlp.Command = "line{'points':[10,10, 20,20, 20,10, 30,20]}";
         hlp.Command = "lines{'points':[10,10, 20,20, 20,10, 30,20]}";
     });
    
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章