コード例 #1
0
 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();
 }
コード例 #2
0
 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));
 }
コード例 #3
0
        public SizeModifierCollection Clone()
        {
            SizeModifierCollection clone = new SizeModifierCollection();

            this.CopyTo(clone);

            return(Clone());
        }
コード例 #4
0
        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]));
        }
コード例 #5
0
        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));
            }
        }
コード例 #6
0
 protected override void CalculateOptimizedSize(Vector2 baseValue, float factor, SizeModifierCollection mod, int index)
 {
     OptimizedSize[index] = factor * baseValue[index];
 }
コード例 #7
0
 protected override void AdjustSize(float factor, SizeModifierCollection mod, int index)
 {
     value[index] = GetSize(factor, OptimizedSize[index], MinSize[index], MaxSize[index]);
 }
コード例 #8
0
 public FloatSizeModifier(float optimizedSize, float minSize, float maxSize)
     : base(optimizedSize, minSize, maxSize, optimizedSize)
 {
     Mod = new SizeModifierCollection(new SizeModifierCollection.SizeModifier(ImpactMode.PixelHeight, 1));
 }
コード例 #9
0
 protected override void CalculateOptimizedSize(Margin baseValue, float factor, SizeModifierCollection mod, int index)
 {
     OptimizedSize[index] = Mathf.RoundToInt(factor * baseValue[index]);
 }
コード例 #10
0
 protected abstract void CalculateOptimizedSize(T baseValue, float factor, SizeModifierCollection mod, int index);