Ejemplo n.º 1
0
        protected override bool TryCreate(string attributeValue, out ITransformOrigin rc)
        {
            var args = Regex.Replace(attributeValue.Trim(), @"[\s,]+", ",")
                       .Split(',');

            if (args.Length != 2)
            {
                rc = null;
                return(false);
            }

            if (!Measure.TryParse(args[0], MeasureUsage.Horizontal, out var xMeasure) ||
                !Measure.TryParse(args[1], MeasureUsage.Vertical, out var yMeasure))
            {
                rc = null;
                return(false);
            }

            rc = new TransformOrigin(xMeasure, yMeasure);
            return(true);
        }
Ejemplo n.º 2
0
 static InitialStyle()
 {
     s_InitialStyle = ComputedStyle.CreateInitial();
     s_InitialStyle.layoutData.Write().alignContent            = Align.FlexStart;
     s_InitialStyle.layoutData.Write().alignItems              = Align.Stretch;
     s_InitialStyle.layoutData.Write().alignSelf               = Align.Auto;
     s_InitialStyle.visualData.Write().backgroundColor         = Color.clear;
     s_InitialStyle.visualData.Write().backgroundImage         = default(Background);
     s_InitialStyle.visualData.Write().borderBottomColor       = Color.clear;
     s_InitialStyle.visualData.Write().borderBottomLeftRadius  = 0f;
     s_InitialStyle.visualData.Write().borderBottomRightRadius = 0f;
     s_InitialStyle.layoutData.Write().borderBottomWidth       = 0f;
     s_InitialStyle.visualData.Write().borderLeftColor         = Color.clear;
     s_InitialStyle.layoutData.Write().borderLeftWidth         = 0f;
     s_InitialStyle.visualData.Write().borderRightColor        = Color.clear;
     s_InitialStyle.layoutData.Write().borderRightWidth        = 0f;
     s_InitialStyle.visualData.Write().borderTopColor          = Color.clear;
     s_InitialStyle.visualData.Write().borderTopLeftRadius     = 0f;
     s_InitialStyle.visualData.Write().borderTopRightRadius    = 0f;
     s_InitialStyle.layoutData.Write().borderTopWidth          = 0f;
     s_InitialStyle.layoutData.Write().bottom           = StyleKeyword.Auto.ToLength();
     s_InitialStyle.inheritedData.Write().color         = Color.black;
     s_InitialStyle.rareData.Write().cursor             = default(Cursor);
     s_InitialStyle.layoutData.Write().display          = DisplayStyle.Flex;
     s_InitialStyle.layoutData.Write().flexBasis        = StyleKeyword.Auto.ToLength();
     s_InitialStyle.layoutData.Write().flexDirection    = FlexDirection.Column;
     s_InitialStyle.layoutData.Write().flexGrow         = 0f;
     s_InitialStyle.layoutData.Write().flexShrink       = 1f;
     s_InitialStyle.layoutData.Write().flexWrap         = Wrap.NoWrap;
     s_InitialStyle.inheritedData.Write().fontSize      = 0f;
     s_InitialStyle.layoutData.Write().height           = StyleKeyword.Auto.ToLength();
     s_InitialStyle.layoutData.Write().justifyContent   = Justify.FlexStart;
     s_InitialStyle.layoutData.Write().left             = StyleKeyword.Auto.ToLength();
     s_InitialStyle.inheritedData.Write().letterSpacing = 0f;
     s_InitialStyle.layoutData.Write().marginBottom     = 0f;
     s_InitialStyle.layoutData.Write().marginLeft       = 0f;
     s_InitialStyle.layoutData.Write().marginRight      = 0f;
     s_InitialStyle.layoutData.Write().marginTop        = 0f;
     s_InitialStyle.layoutData.Write().maxHeight        = StyleKeyword.None.ToLength();
     s_InitialStyle.layoutData.Write().maxWidth         = StyleKeyword.None.ToLength();
     s_InitialStyle.layoutData.Write().minHeight        = StyleKeyword.Auto.ToLength();
     s_InitialStyle.layoutData.Write().minWidth         = StyleKeyword.Auto.ToLength();
     s_InitialStyle.visualData.Write().opacity          = 1f;
     s_InitialStyle.visualData.Write().overflow         = OverflowInternal.Visible;
     s_InitialStyle.layoutData.Write().paddingBottom    = 0f;
     s_InitialStyle.layoutData.Write().paddingLeft      = 0f;
     s_InitialStyle.layoutData.Write().paddingRight     = 0f;
     s_InitialStyle.layoutData.Write().paddingTop       = 0f;
     s_InitialStyle.layoutData.Write().position         = Position.Relative;
     s_InitialStyle.layoutData.Write().right            = StyleKeyword.Auto.ToLength();
     s_InitialStyle.transformData.Write().rotate        = StyleKeyword.None.ToRotate();
     s_InitialStyle.transformData.Write().scale         = StyleKeyword.None.ToScale();
     s_InitialStyle.rareData.Write().textOverflow       = TextOverflow.Clip;
     s_InitialStyle.inheritedData.Write().textShadow    = default(TextShadow);
     s_InitialStyle.layoutData.Write().top = StyleKeyword.Auto.ToLength();
     s_InitialStyle.transformData.Write().transformOrigin  = TransformOrigin.Initial();
     s_InitialStyle.transitionData.Write().transitionDelay = new List <TimeValue> {
         0
     };
     s_InitialStyle.transitionData.Write().transitionDuration = new List <TimeValue> {
         0
     };
     s_InitialStyle.transitionData.Write().transitionProperty = new List <StylePropertyName> {
         "all"
     };
     s_InitialStyle.transitionData.Write().transitionTimingFunction = new List <EasingFunction> {
         EasingMode.Ease
     };
     s_InitialStyle.transformData.Write().translate = StyleKeyword.None.ToTranslate();
     s_InitialStyle.rareData.Write().unityBackgroundImageTintColor = Color.white;
     s_InitialStyle.rareData.Write().unityBackgroundScaleMode      = ScaleMode.StretchToFill;
     s_InitialStyle.inheritedData.Write().unityFont               = default(Font);
     s_InitialStyle.inheritedData.Write().unityFontDefinition     = default(FontDefinition);
     s_InitialStyle.inheritedData.Write().unityFontStyleAndWeight = FontStyle.Normal;
     s_InitialStyle.rareData.Write().unityOverflowClipBox         = OverflowClipBox.PaddingBox;
     s_InitialStyle.inheritedData.Write().unityParagraphSpacing   = 0f;
     s_InitialStyle.rareData.Write().unitySliceBottom             = 0;
     s_InitialStyle.rareData.Write().unitySliceLeft               = 0;
     s_InitialStyle.rareData.Write().unitySliceRight              = 0;
     s_InitialStyle.rareData.Write().unitySliceTop              = 0;
     s_InitialStyle.inheritedData.Write().unityTextAlign        = TextAnchor.UpperLeft;
     s_InitialStyle.inheritedData.Write().unityTextOutlineColor = Color.clear;
     s_InitialStyle.inheritedData.Write().unityTextOutlineWidth = 0f;
     s_InitialStyle.rareData.Write().unityTextOverflowPosition  = TextOverflowPosition.End;
     s_InitialStyle.inheritedData.Write().visibility            = Visibility.Visible;
     s_InitialStyle.inheritedData.Write().whiteSpace            = WhiteSpace.Normal;
     s_InitialStyle.layoutData.Write().width          = StyleKeyword.Auto.ToLength();
     s_InitialStyle.inheritedData.Write().wordSpacing = 0f;
 }
Ejemplo n.º 3
0
 public BuilderTransformOrigin(TransformOrigin transformOrigin)
 {
     x = new Dimension(transformOrigin.x.value, StyleSheetUtilities.ConvertToDimensionUnit(transformOrigin.x.unit));
     y = new Dimension(transformOrigin.y.value, StyleSheetUtilities.ConvertToDimensionUnit(transformOrigin.y.unit));
 }
Ejemplo n.º 4
0
 public RotateTo(TimeSpan duration, Quaternion target, Easing easing = Easing.Linear, TransformOrigin transformOrigin = TransformOrigin.Local) : base(duration, target, easing)
 {
     _transformOrigin = transformOrigin;
 }
Ejemplo n.º 5
0
 public MoveTo(TimeSpan duration, Vector3 target, Easing easing = Easing.Linear, TransformOrigin transformOrigin = TransformOrigin.Local) : base(duration, target, easing)
 {
     _transformOrigin = transformOrigin;
 }