예제 #1
0
        private void OnGridChanged()
        {
            if (grid != null)
            {
                if (grid.Width != GridWidth || grid.Height != GridHeight)
                {
                    grid.Abort();
                    grid.SetSize(GridWidth, GridHeight);

                    if (mesh != null)
                    {
                        mesh.Clear();
                    }
                    if (surface != null)
                    {
                        surface.CopySurface(EnvironmentParameters.SourceSurface);
                    }
                }
            }
            else if (mesh != null)
            {
                grid = new DisplacementGrid(GridWidth, GridHeight, mesh, linearInterpolationBtn.Checked);
                InitializeRenderer();
            }

            canvas.InvalidateCanvas();
        }
예제 #2
0
        private void OnGridChanged()
        {
            if (grid != null)
            {
                if (grid.Width != GridWidth || grid.Height != GridHeight)
                {
                    grid.Abort();
                    grid.SetSize(GridWidth, GridHeight);

                    if (mesh != null)
                    {
                        mesh.Clear();
                    }
                    if (surface != null)
                    {
                        surface.CopySurface(EffectSourceSurface);
                    }
                }
            }
            else if (mesh != null)
            {
                grid = new DisplacementGrid(GridWidth, GridHeight, mesh);
                InitializeRenderer();
            }

            canvas.InvalidateCanvas();
        }