コード例 #1
0
ファイル: PCamera.cs プロジェクト: stangelandcl/piccolo2d.net
        //****************************************************************
        // Paint Damage Management - Methods used to invalidate the areas
        // of the screen that that need to be repainted.
        //****************************************************************

        /// <summary>
        /// Overridden.  Repaint this camera, and forward the repaint request to the camera's
        /// canvas if it is not null.
        /// </summary>
        /// <param name="bounds">The bounds to repaint, in local coordinates.</param>
        /// <param name="childOrThis">
        /// If childOrThis does not equal this then this camera's matrix will be applied to the
        /// bounds paramater.
        /// </param>
        public override void RepaintFrom(RectangleF bounds, PNode childOrThis)
        {
            if (Parent != null)
            {
                if (childOrThis != this)
                {
                    bounds = LocalToParent(bounds);
                }

                if (Canvas != null)
                {
                    Canvas.InvalidateBounds(bounds);
                }

                Parent.RepaintFrom(bounds, this);
            }
        }