void UpdateValueOnMouseMove(MouseMoveEvent evt)
 {
     if (dragging)
     {
         DeltaSpeed s = evt.shiftKey ? DeltaSpeed.Fast : (evt.altKey ? DeltaSpeed.Slow : DeltaSpeed.Normal);
         m_DrivenField.ApplyInputDeviceDelta(evt.mouseDelta, s, startValue);
     }
 }
 private void ProcessMoveEvent(bool shiftKey, bool altKey, Vector2 deltaPosition)
 {
     if (dragging)
     {
         DeltaSpeed s = shiftKey ? DeltaSpeed.Fast : (altKey ? DeltaSpeed.Slow : DeltaSpeed.Normal);
         m_DrivenField.ApplyInputDeviceDelta(deltaPosition, s, startValue);
     }
 }
Ejemplo n.º 3
0
 private void UpdateValueOnMouseMove(MouseMoveEvent evt)
 {
     if (this.dragging)
     {
         DeltaSpeed speed = (!evt.shiftKey) ? ((!evt.altKey) ? DeltaSpeed.Normal : DeltaSpeed.Slow) : DeltaSpeed.Fast;
         this.m_DrivenField.ApplyInputDeviceDelta(evt.mouseDelta, speed, this.startValue);
     }
 }
Ejemplo n.º 4
0
        public override void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, int startValue)
        {
            double sensitivity  = NumericFieldDraggerUtility.CalculateIntDragSensitivity(startValue);
            float  acceleration = NumericFieldDraggerUtility.Acceleration(speed == DeltaSpeed.Fast, speed == DeltaSpeed.Slow);
            long   v            = value;

            v    += (long)Math.Round(NumericFieldDraggerUtility.NiceDelta(delta, acceleration) * sensitivity);
            value = MathUtils.ClampToInt(v);
        }
Ejemplo n.º 5
0
        public override void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, long startValue)
        {
            double num          = (double)NumericFieldDraggerUtility.CalculateIntDragSensitivity(startValue);
            float  acceleration = NumericFieldDraggerUtility.Acceleration(speed == DeltaSpeed.Fast, speed == DeltaSpeed.Slow);
            long   num2         = base.value;

            num2 += (long)Math.Round((double)NumericFieldDraggerUtility.NiceDelta(delta, acceleration) * num);
            base.SetValueAndNotify(num2);
        }
Ejemplo n.º 6
0
        /// <inheritdoc />
        public override void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, float startValue)
        {
            double sensitivity  = NumericFieldDraggerUtility.CalculateFloatDragSensitivity(startValue, lowValue, highValue);
            float  acceleration = NumericFieldDraggerUtility.Acceleration(speed == DeltaSpeed.Fast, speed == DeltaSpeed.Slow);
            double v            = value;

            v    += NumericFieldDraggerUtility.NiceDelta(delta, acceleration) * sensitivity;
            value = (float)v;
        }
Ejemplo n.º 7
0
 /// <summary>
 /// 设置变化速度
 /// </summary>
 /// <param name="_deltaSpeeds"></param>
 /// <returns></returns>
 public Boom setDeltaSpeed(List <DeltaSpeed> _deltaSpeeds)
 {
     this.deltaSpeeds = new DeltaSpeed[_deltaSpeeds.Count];
     for (int i = 0; i < _deltaSpeeds.Count; i++)
     {
         deltaSpeeds[i] = new DeltaSpeed(_deltaSpeeds[i].startDeltaTime, _deltaSpeeds[i].speed, _deltaSpeeds[i].addSpeed);
     }
     return(this);
 }
Ejemplo n.º 8
0
        public override void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, float startValue)
        {
            double sensitivity  = NumericFieldDraggerUtility.CalculateFloatDragSensitivity(startValue);
            float  acceleration = NumericFieldDraggerUtility.Acceleration(speed == DeltaSpeed.Fast, speed == DeltaSpeed.Slow);
            double v            = value;

            v += NumericFieldDraggerUtility.NiceDelta(delta, acceleration) * sensitivity;
            v  = MathUtils.RoundBasedOnMinimumDifference(v, sensitivity);
            SetValueAndNotify(MathUtils.ClampToFloat(v));
        }
Ejemplo n.º 9
0
        public override void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, double startValue)
        {
            double num          = NumericFieldDraggerUtility.CalculateFloatDragSensitivity(startValue);
            float  acceleration = NumericFieldDraggerUtility.Acceleration(speed == DeltaSpeed.Fast, speed == DeltaSpeed.Slow);
            double num2         = base.value;

            num2 += (double)NumericFieldDraggerUtility.NiceDelta(delta, acceleration) * num;
            num2  = MathUtils.RoundBasedOnMinimumDifference(num2, num);
            base.SetValueAndNotify(num2);
        }
            public override void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, uint startValue)
            {
                var num   = StringToValue(text) + (long)Math.Round(delta.x);
                var value = ClampInput(num);

                if (parentUIntField.isDelayed)
                {
                    text = ValueToString(value);
                }
                else
                {
                    parentUIntField.value = value;
                }
            }
Ejemplo n.º 11
0
 public override void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, int startValue)
 {
     double sensitivity = NumericFieldDraggerUtility.CalculateIntDragSensitivity(startValue);
     float acceleration = NumericFieldDraggerUtility.Acceleration(speed == DeltaSpeed.Fast, speed == DeltaSpeed.Slow);
     long v = StringToValue(text);
     v += (long)Math.Round(NumericFieldDraggerUtility.NiceDelta(delta, acceleration) * sensitivity);
     if (parentIntegerField.isDelayed)
     {
         text = ValueToString(MathUtils.ClampToInt(v));
     }
     else
     {
         parentIntegerField.value = MathUtils.ClampToInt(v);
     }
 }
Ejemplo n.º 12
0
            public override void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, double startValue)
            {
                double sensitivity  = NumericFieldDraggerUtility.CalculateFloatDragSensitivity(startValue);
                float  acceleration = NumericFieldDraggerUtility.Acceleration(speed == DeltaSpeed.Fast, speed == DeltaSpeed.Slow);
                double v            = StringToValue(text);

                v += NumericFieldDraggerUtility.NiceDelta(delta, acceleration) * sensitivity;
                v  = MathUtils.RoundBasedOnMinimumDifference(v, sensitivity);
                if (parentDoubleField.isDelayed)
                {
                    text = ValueToString(v);
                }
                else
                {
                    parentDoubleField.value = v;
                }
            }
Ejemplo n.º 13
0
            public override void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, StyleLength startValue)
            {
                if (startValue.keyword != StyleKeyword.Undefined)
                {
                    startValue = new StyleLength();
                }

                double sensitivity  = NumericFieldDraggerUtility.CalculateIntDragSensitivity((long)startValue.value.value);
                float  acceleration = NumericFieldDraggerUtility.Acceleration(speed == DeltaSpeed.Fast, speed == DeltaSpeed.Slow);
                long   v            = (long)StringToValue(text).value.value;

                v += (long)Math.Round(NumericFieldDraggerUtility.NiceDelta(delta, acceleration) * sensitivity);
                if (parentLengthField.isDelayed)
                {
                    text = ValueToString(MathUtils.ClampToInt(v));
                }
                else
                {
                    Length l = new Length(MathUtils.ClampToInt(v), parentLengthField.value.value.unit);
                    parentLengthField.value = new StyleLength(l);
                }
            }
Ejemplo n.º 14
0
 public override void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, int startValue)
 {
     integerInput.ApplyInputDeviceDelta(delta, speed, startValue);
 }
Ejemplo n.º 15
0
 /// <summary>
 /// Modify the value using a 3D delta and a speed, typically coming from an input device.
 /// </summary>
 /// <param name="delta">A vector used to compute the value change.</param>
 /// <param name="speed">A multiplier for the value change.</param>
 /// <param name="startValue">The start value.</param>
 public override void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, double startValue)
 {
     doubleInput.ApplyInputDeviceDelta(delta, speed, startValue);
 }
Ejemplo n.º 16
0
 /// <summary>
 /// Called when the user is dragging the label to update the value contained in the field.
 /// </summary>
 /// <param name="delta">Delta on the move.</param>
 /// <param name="speed">Speed of the move.</param>
 /// <param name="startValue">Starting value.</param>
 public abstract void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, TValueType startValue);
Ejemplo n.º 17
0
 public override void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, long startValue)
 {
     longInput.ApplyInputDeviceDelta(delta, speed, startValue);
 }
Ejemplo n.º 18
0
 /// <summary>
 /// Called when the user is dragging the label to update the value contained in the field.
 /// </summary>
 /// <param name="delta">Delta on the move.</param>
 /// <param name="speed">Speed of the move.</param>
 /// <param name="startValue">Starting value.</param>
 public virtual void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, TValueType startValue)
 {
 }
Ejemplo n.º 19
0
 public override void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, float startValue)
 {
     floatInput.ApplyInputDeviceDelta(delta, speed, startValue);
 }
Ejemplo n.º 20
0
 public override void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, StyleLength startValue)
 {
     lengthInput.ApplyInputDeviceDelta(delta, speed, startValue);
 }
Ejemplo n.º 21
0
 public override void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, string startValue)
 {
 }