Exemplo n.º 1
0
        protected void Initialize()
        {
            double num;

            this.OnInitializing();
            this.stamp = BrushToolChangesBase <TDerived, TTool> .GetCachedStamp((double)this.PenWidth, (double)this.Hardness, 1.0, this.Antialiasing);

            if (this.Antialiasing)
            {
                num = this.PenWidth * 0.15;
            }
            else
            {
                num = 1.0;
            }
            double stampSpacingPx = Math.Max(1.0, num);
            BrushStrokeLengthMetric lengthMetric = this.Antialiasing ? BrushStrokeLengthMetric.Euclidean : BrushStrokeLengthMetric.Anamorphic;

            this.renderData = new BrushStrokeRenderData(this.stamp.Size, stampSpacingPx, 8, lengthMetric);
            this.renderData.AddInputPoints(this.InputPoints);
            this.renderData.EnsureStrokeSamplesUpdated();
            this.renderDataCurrencyToken = this.renderData.CreateCurrencyToken();
            this.renderCache             = new BrushStrokeRenderCache(this.renderData, this.stamp, this.renderData.TileEdgeLog2);
            this.OnInitialized();
        }
Exemplo n.º 2
0
 protected BrushToolChangesBase(TDerived oldChanges, IEnumerable <BrushInputPoint> newInputPoints) : base(oldChanges.DrawingSettingsValues)
 {
     this.InputPoints = oldChanges.InputPoints.Concat <BrushInputPoint>(newInputPoints).ToArrayEx <BrushInputPoint>();
     this.stamp       = oldChanges.Stamp;
     this.renderData  = oldChanges.RenderData;
     this.renderData.AddInputPoints(newInputPoints);
     this.renderData.EnsureStrokeSamplesUpdated();
     this.renderCache             = oldChanges.RenderCache;
     this.renderDataCurrencyToken = this.renderData.CreateCurrencyToken();
     this.isInitialized           = true;
 }
Exemplo n.º 3
0
        protected void Initialize()
        {
            this.OnInitializing();
            this.stamp = BrushToolChangesBase <TDerived, TTool> .stampCache.Get(TupleStruct.Create <double, double, double, bool>((double)this.PenWidth, (double)this.Hardness, 1.0, this.Antialiasing));

            double num            = this.PenWidth * 0.15;
            double stampSpacingPx = Math.Max(1.0, num);
            BrushStrokeLengthMetric lengthMetric = this.Antialiasing ? BrushStrokeLengthMetric.Euclidean : BrushStrokeLengthMetric.Anamorphic;

            this.renderData = new BrushStrokeRenderData(this.stamp.Size, stampSpacingPx, 7, lengthMetric);
            this.renderData.AddInputPoints(this.InputPoints);
            this.renderData.EnsureStrokeSamplesUpdated();
            this.renderDataCurrencyToken = this.renderData.CreateCurrencyToken();
            this.renderCache             = new BrushStrokeRenderCache(this.renderData, this.stamp, 7);
            this.OnInitialized();
        }