Beispiel #1
0
        /// <summary>
        /// Scales current coordinate system.
        /// </summary>
        public static void Scale(this Nvg nvg, Vector2D <float> scale)
        {
            Matrix3X2 <float> t = nvg.TransformScale(scale);

            nvg.stateStack.CurrentState.Transform = nvg.TransformPremultiply(nvg.stateStack.CurrentState.Transform, t);
        }
Beispiel #2
0
        /// <summary>
        /// Translates current coordinate system.
        /// </summary>
        public static void Translate(this Nvg nvg, Vector2D <float> position)
        {
            Matrix3X2 <float> t = nvg.TransformTranslate(position);

            nvg.stateStack.CurrentState.Transform = nvg.TransformPremultiply(nvg.stateStack.CurrentState.Transform, t);
        }
Beispiel #3
0
        /// <summary>
        /// Skews the current coordinate system along Y axis.
        /// </summary>
        /// <param name="angle">Is specified in radians.</param>
        public static void SkewY(this Nvg nvg, float angle)
        {
            Matrix3X2 <float> t = nvg.TransformSkewY(angle);

            nvg.stateStack.CurrentState.Transform = nvg.TransformPremultiply(nvg.stateStack.CurrentState.Transform, t);
        }
Beispiel #4
0
 /// <summary>
 /// Premultiplies currentn coordinate system by specified matrix.
 /// For matrix layout <see cref="NvgTransforms"/>
 /// </summary>
 public static void Transform(this Nvg nvg, Matrix3X2 <float> transform)
 {
     nvg.stateStack.CurrentState.Transform = nvg.TransformPremultiply(nvg.stateStack.CurrentState.Transform, transform);
 }