public Vector3SizeModifier(Vector3 optimizedSize, Vector3 minSize, Vector3 maxSize)
     : base(optimizedSize, minSize, maxSize, optimizedSize)
 {
     ModX = new SizeModifierCollection(new SizeModifierCollection.SizeModifier(ImpactMode.PixelHeight, 1));
     ModY = new SizeModifierCollection(new SizeModifierCollection.SizeModifier(ImpactMode.PixelHeight, 1));
     ModZ = new SizeModifierCollection();
 }
 public MarginSizeModifier(Margin optimizedSize, Margin minSize, Margin maxSize)
     : base(optimizedSize, minSize, maxSize, optimizedSize.Clone())
 {
     ModLeft   = new SizeModifierCollection(new SizeModifierCollection.SizeModifier(ImpactMode.PixelWidth, 1));
     ModRight  = new SizeModifierCollection(new SizeModifierCollection.SizeModifier(ImpactMode.PixelWidth, 1));
     ModTop    = new SizeModifierCollection(new SizeModifierCollection.SizeModifier(ImpactMode.PixelWidth, 1));
     ModBottom = new SizeModifierCollection(new SizeModifierCollection.SizeModifier(ImpactMode.PixelWidth, 1));
 }
        public SizeModifierCollection Clone()
        {
            SizeModifierCollection clone = new SizeModifierCollection();

            this.CopyTo(clone);

            return(Clone());
        }
        protected override void AdjustSize(float factor, SizeModifierCollection mod, int index)
        {
            if (this.value == null)
            {
                this.value = new Margin();
            }

            value[index] = Mathf.RoundToInt(GetSize(factor, OptimizedSize[index], MinSize[index], MaxSize[index]));
        }
        public void CopyTo(SizeModifierCollection other)
        {
            other.SizeModifiers.Clear();

            other.ExponentialScale = this.ExponentialScale;

            foreach (var mod in this.SizeModifiers)
            {
                other.SizeModifiers.Add(new SizeModifier(mod.Mode, mod.Impact));
            }
        }
 protected override void CalculateOptimizedSize(Vector2 baseValue, float factor, SizeModifierCollection mod, int index)
 {
     OptimizedSize[index] = factor * baseValue[index];
 }
 protected override void AdjustSize(float factor, SizeModifierCollection mod, int index)
 {
     value[index] = GetSize(factor, OptimizedSize[index], MinSize[index], MaxSize[index]);
 }
 public FloatSizeModifier(float optimizedSize, float minSize, float maxSize)
     : base(optimizedSize, minSize, maxSize, optimizedSize)
 {
     Mod = new SizeModifierCollection(new SizeModifierCollection.SizeModifier(ImpactMode.PixelHeight, 1));
 }
 protected override void CalculateOptimizedSize(Margin baseValue, float factor, SizeModifierCollection mod, int index)
 {
     OptimizedSize[index] = Mathf.RoundToInt(factor * baseValue[index]);
 }
Ejemplo n.º 10
0
 protected abstract void CalculateOptimizedSize(T baseValue, float factor, SizeModifierCollection mod, int index);