Exemple #1
0
        public void ResizeTo(float w, float h)
        {
#if DEBUG
            Time.AssertTimeThread();
#endif

            this.Width  = w;
            this.Height = h;
            SizeOrPositionChanged.Fire();
        }
Exemple #2
0
        public void MoveTo(float x, float y, int?z = null)
        {
#if DEBUG
            Time.AssertTimeThread();
#endif

            this.Left = x;
            this.Top  = y;
            if (z.HasValue)
            {
                this.ZIndex = z.Value;
            }

            SizeOrPositionChanged.Fire();
        }
Exemple #3
0
        public void MoveTo(float x, float y, int?z = null)
        {
            Time.AssertTimeThread();

            if (float.IsNaN(x))
            {
                x = 0;
            }

            if (float.IsNaN(y))
            {
                y = 0;
            }

            this.Left = x;
            this.Top  = y;
            if (z.HasValue)
            {
                this.ZIndex = z.Value;
            }

            SizeOrPositionChanged.Fire();
        }
Exemple #4
0
        public void MoveTo(float x, float y, int?z = null)
        {
            Time.AssertTimeThread();

            x = x < 0 ? 0 : x;
            y = y < 0 ? 0 : y;

            if (x + Width > SpaceTime.CurrentSpaceTime.Width)
            {
                x = SpaceTime.CurrentSpaceTime.Width - Width;
            }

            if (y + Height > SpaceTime.CurrentSpaceTime.Height)
            {
                y = SpaceTime.CurrentSpaceTime.Height - Height;
            }

            if (float.IsNaN(x))
            {
                x = 0;
            }

            if (float.IsNaN(y))
            {
                y = 0;
            }

            this.Left = x;
            this.Top  = y;
            if (z.HasValue)
            {
                this.ZIndex = z.Value;
            }

            SizeOrPositionChanged.Fire();
        }