示例#1
0
文件: Theme.cs 项目: thehall45/GGNet
        public Theme(bool dark, Position axisY, Position legend)
        {
            FontFamily = "-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,\"Helvetica Neue\",Arial,\"Noto Sans\",sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\"";

            Plot = new _Plot(dark);

            Panel = new _Panel(dark);

            Axis = new _Axis(dark, axisY);

            Legend = new _Legend(dark, legend);

            Strip = new _Strip(dark);

            Animation = new _Animation();

            Tooltip = new _Tooltip();
        }
示例#2
0
        public Theme(bool dark, Position axisY, Position legend)
        {
            FontFamily = "-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,\"Helvetica Neue\",Arial,\"Noto Sans\",sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\"";

            Plot = new _Plot(dark);

            Panel = new _Panel(dark);

            Axis = new _Axis(dark, axisY);

            Legend = new _Legend(dark, legend);

            Strip = new _Strip(dark);

            Animation = new _Animation();

            Tooltip = new Text
            {
                Size = new Size
                {
                    Value = 0.75,
                    Units = em
                },
                Color = "#FFF",
                Alpha = 0.8
            };

            YLabel = new Text
            {
                Size = new Size
                {
                    Value = 0.75,
                    Units = em
                },
                Color = dark ? "#252A32" : "#FFFFFF",
                Fill  = dark ? "#FFFFFF" : "#252A32"
            };
        }
示例#3
0
        public virtual void Update(_Animation animation)
        {
            switch (timeSpanType)
            {
            case Type.AnimStartAndEnd:
                startTime  = 0;
                endTime    = startTime + animation.Duration;
                duration   = animation.Duration;
                startFrame = Mathf.RoundToInt(startTime / (1f / animation.framesPerSecond));
                endFrame   = Mathf.RoundToInt(endTime / (1f / animation.framesPerSecond));
                frameCount = endFrame - startFrame;
                break;

            case Type.AnimStartAndEndFrame:
                startFrame = Mathf.Clamp(startFrame, 0, startFrame + animation.FrameCount);
                startTime  = startFrame * (1f / animation.framesPerSecond);
                endFrame   = Mathf.Clamp(endFrame, startFrame, startFrame + animation.FrameCount);
                frameCount = animation.FrameCount;
                endTime    = startTime + animation.Duration;
                duration   = 1f / animation.framesPerSecond * frameCount;
                break;

            case Type.AnimStartAndEndTime:
                startTime  = MathfExtensions.SnapToInterval(startTime, 1f / animation.framesPerSecond);
                startTime  = Mathf.Clamp(startTime, 0, animation.Duration);
                endTime    = MathfExtensions.SnapToInterval(endTime, 1f / animation.framesPerSecond);
                endTime    = Mathf.Clamp(endTime, startTime, startTime + animation.Duration);
                startFrame = Mathf.RoundToInt(startTime / (1f / animation.framesPerSecond));
                startFrame = Mathf.Clamp(startFrame, 0, int.MaxValue);
                endFrame   = Mathf.RoundToInt(endTime / (1f / animation.framesPerSecond));
                endFrame   = Mathf.Clamp(endFrame, 0, int.MaxValue);
                frameCount = endFrame - startFrame;
                duration   = endTime - startTime;
                break;

            case Type.AnimStartFrameAndCount:
                startFrame = Mathf.Clamp(startFrame, 0, animation.FrameCount);
                frameCount = Mathf.Clamp(frameCount, 0, animation.FrameCount);
                startTime  = 1f / animation.framesPerSecond * startFrame;
                endFrame   = startFrame + frameCount;
                endTime    = startTime + animation.Duration;
                duration   = 1f / animation.framesPerSecond * frameCount;
                break;

            case Type.AnimStartTimeAndDuration:
                startTime  = MathfExtensions.SnapToInterval(startTime, 1f / animation.framesPerSecond);
                startTime  = Mathf.Clamp(startTime, 0, startTime + animation.Duration);
                duration   = Mathf.Clamp(duration, 0, animation.Duration);
                endTime    = startTime + duration;
                startFrame = Mathf.RoundToInt(startTime / (1f / animation.framesPerSecond));
                endFrame   = Mathf.RoundToInt(endTime / (1f / animation.framesPerSecond));
                frameCount = endFrame - startFrame;
                break;

            case Type.FrameCount:
                startTime  = MathfExtensions.NULL_FLOAT;
                endTime    = MathfExtensions.NULL_FLOAT;
                duration   = MathfExtensions.NULL_FLOAT;
                startFrame = MathfExtensions.NULL_INT;
                endFrame   = MathfExtensions.NULL_INT;
                break;

            case Type.StartAndEndTime:
                startTime  = Mathf.Clamp(startTime, 0, Mathf.Infinity);
                endTime    = Mathf.Clamp(endTime, startTime, Mathf.Infinity);
                startFrame = MathfExtensions.NULL_INT;
                endFrame   = MathfExtensions.NULL_INT;
                frameCount = MathfExtensions.NULL_INT;
                duration   = endTime - startTime;
                break;

            case Type.StartTimeAndDuration:
                startTime  = Mathf.Clamp(startTime, 0, Mathf.Infinity);
                duration   = Mathf.Clamp(duration, 0, Mathf.Infinity);
                endTime    = startTime + duration;
                startFrame = MathfExtensions.NULL_INT;
                endFrame   = MathfExtensions.NULL_INT;
                frameCount = MathfExtensions.NULL_INT;
                break;

            case Type.Infinite:
                duration   = Mathf.Infinity;
                startTime  = MathfExtensions.NULL_FLOAT;
                endTime    = MathfExtensions.NULL_FLOAT;
                startFrame = MathfExtensions.NULL_INT;
                endFrame   = MathfExtensions.NULL_INT;
                frameCount = MathfExtensions.NULL_INT;
                break;
            }
        }
示例#4
0
 public virtual void Update(_Animation animation)
 {
     timeSpan.Update(animation);
 }