OSDN Git Service

clock interval
[psychlops/silverlight.git] / dev3 / psychlops / core / graphic / canvas.cs
index 297499e..9d2cad3 100644 (file)
@@ -207,9 +207,12 @@ namespace Psychlops
                        if (nextIntervalFrame <= 0)\r
                        {\r
                                var tmp = new System.Windows.Controls.Canvas();\r
-                               foreach (Internal.PrimitiveFigure f in stack)\r
+                               if (stack.Count > 0)\r
                                {\r
-                                       tmp.Children.Add(f.toNative());\r
+                                       foreach (Internal.PrimitiveFigure f in stack)\r
+                                       {\r
+                                               tmp.Children.Add(f.toNative());\r
+                                       }\r
                                }\r
                                api_canvas.Children.Clear();\r
                                api_canvas.Children.Add(tmp);\r