Beispiel #1
0
        public void ApplyTransform(IContext2d ctx)
        {
            if (Parent != null)
                Parent.ApplyTransform (ctx);

            if (transform) {
                // transform the context relative to this layer

                ctx.Translate (Bounds.X, Bounds.Y);

                // clip the context to this layers's dimensions
                ctx.BeginPath ();
                ctx.Rect (0, 0, Bounds.Width, Bounds.Height);
                ctx.Clip ();

                // if a scale factor is set, do that too
                ctx.Scale (ScaleX, ScaleY);
            }
        }