Beispiel #1
0
        public NvgState Clone()
        {
            var newState = new NvgState();

            newState.CompositeOperation = CompositeOperation;
            newState.Fill        = Fill.Clone();
            newState.Stroke      = Stroke.Clone();
            newState.StrokeWidth = StrokeWidth;
            newState.MiterLimit  = MiterLimit;
            newState.LineJoin    = LineJoin;
            newState.LineCap     = LineCap;
            newState.Alpha       = Alpha;

            Array.Copy(Xform, newState.Xform, Xform.Length);

            newState.Scissor       = Scissor.Clone();
            newState.FontSize      = FontSize;
            newState.LetterSpacing = LetterSpacing;
            newState.LineHeight    = LineHeight;
            newState.FontBlur      = FontBlur;
            newState.TextAlign     = TextAlign;
            newState.FontId        = FontId;

            return(newState);
        }
Beispiel #2
0
 public NvgContext()
 {
     States = new NvgState[NanoVg.NvgMaxStates];
     for (var cont = 0; cont < States.Length; cont++)
     {
         States[cont] = new NvgState();
     }
     FontImages = new int[NanoVg.NvgMaxFontimages];
 }