private void ApplyPercentageOf(IDataModel dataModel, LayerPropertiesModel properties, float src)
        {
            if (GameProperty == null)
                return;

            var gameProperty = dataModel.GetPropValue<float>(GameProperty);
            var percentage = gameProperty/src;

            if (LayerProperty == "Width")
                ApplyWidth(properties, percentage);
            else if (LayerProperty == "Height")
                ApplyHeight(properties, percentage);
            else if (LayerProperty == "Opacity")
                ApplyOpacity(properties, percentage);
        }
Example #2
0
        private void ApplyPercentageOf(IDataModel dataModel, ref AppliedProperties properties, double src)
        {
            if (GameProperty == null)
            {
                return;
            }

            var gameProperty = dataModel.GetPropValue <int>(GameProperty);
            var percentage   = ToDouble(gameProperty) / src;

            if (LayerProperty == "Width")
            {
                ApplyWidth(ref properties, percentage);
            }
            else if (LayerProperty == "Height")
            {
                ApplyHeight(ref properties, percentage);
            }
            else if (LayerProperty == "Opacity")
            {
                ApplyOpacity(ref properties, percentage);
            }
        }
        private void ApplyPercentageOf(IDataModel dataModel, LayerPropertiesModel properties, float src)
        {
            if (GameProperty == null)
            {
                return;
            }

            var gameProperty = dataModel.GetPropValue <float>(GameProperty);
            var percentage   = gameProperty / src;

            if (LayerProperty == "Width")
            {
                ApplyWidth(properties, percentage);
            }
            else if (LayerProperty == "Height")
            {
                ApplyHeight(properties, percentage);
            }
            else if (LayerProperty == "Opacity")
            {
                ApplyOpacity(properties, percentage);
            }
        }
 private void ApplyPercentageOfProperty(IDataModel dataModel, LayerPropertiesModel properties)
 {
     var value = dataModel.GetPropValue<float>(PercentageProperty);
     ApplyPercentageOf(dataModel, properties, value);
 }
Example #5
0
        private void ApplyPercentageOfProperty(IDataModel dataModel, ref AppliedProperties properties)
        {
            var value = dataModel.GetPropValue <int>(PercentageProperty);

            ApplyPercentageOf(dataModel, ref properties, value);
        }
        private void ApplyPercentageOfProperty(IDataModel dataModel, LayerPropertiesModel properties)
        {
            var value = dataModel.GetPropValue <float>(PercentageProperty);

            ApplyPercentageOf(dataModel, properties, value);
        }