因爲有好幾個同學問到如何將多個圖形操作步驟合併成一個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]}"; });