예제 #1
0
        private void AdjustScaleSize(MapGraphics g)
        {
            float markerLength = Pointer.MarkerLength;
            float width        = Pointer.Width;
            float num          = 0f;

            if (GetOrientation() == Orientation.Horizontal)
            {
                markerLength = g.GetAbsoluteY(markerLength);
                width        = g.GetAbsoluteY(width);
                num          = (g.GetAbsoluteY(100f) - markerLength) / 2f;
            }
            else
            {
                markerLength = g.GetAbsoluteX(markerLength);
                width        = g.GetAbsoluteX(width);
                num          = (g.GetAbsoluteX(100f) - markerLength) / 2f;
            }
            float num2 = 2f + width / 2f;

            if (ZoomButtonsVisible)
            {
                num2 += markerLength + num;
            }
            num2 = ((GetOrientation() != 0) ? g.GetRelativeY(num2) : g.GetRelativeX(num2));
            num2 = Math.Min(Math.Max(0f, num2), 100f);
            Scale.StartMargin = num2;
            Scale.EndMargin   = num2;
        }
예제 #2
0
        private void RenderButton(MapGraphics g, PanelButton button)
        {
            float markerLength = Pointer.MarkerLength;

            markerLength += 5f;
            float  num  = 0f;
            float  num2 = 0f;
            float  num3;
            PointF relative;

            if (GetOrientation() == Orientation.Horizontal)
            {
                float relativeY = (100f - markerLength) / 2f;
                relativeY    = g.GetRelativeX(g.GetAbsoluteY(relativeY));
                markerLength = g.GetRelativeX(g.GetAbsoluteY(markerLength));
                num3         = g.GetAbsoluteX(markerLength);
                relative     = new PointF(markerLength / 2f + relativeY, 50f);
                if ((button.Type == PanelButtonType.ZoomOut && GetReversed()) || (button.Type == PanelButtonType.ZoomButton && !GetReversed()))
                {
                    num = 100f - markerLength - 2f * relativeY;
                }
            }
            else
            {
                float relativeX = (100f - markerLength) / 2f;
                relativeX    = g.GetRelativeY(g.GetAbsoluteX(relativeX));
                markerLength = g.GetRelativeY(g.GetAbsoluteX(markerLength));
                num3         = g.GetAbsoluteY(markerLength);
                relative     = new PointF(50f, markerLength / 2f + relativeX);
                if ((button.Type == PanelButtonType.ZoomOut && !GetReversed()) || (button.Type == PanelButtonType.ZoomButton && GetReversed()))
                {
                    num2 = 100f - markerLength - 2f * relativeX;
                }
            }
            relative.X += num;
            relative.Y += num2;
            relative    = g.GetAbsolutePoint(relative);
            RectangleF absolute = new RectangleF(relative.X, relative.Y, 0f, 0f);

            absolute.Inflate(num3 / 2f, num3 / 2f);
            button.Bounds = g.GetRelativeRectangle(absolute);
            button.Render(g);
        }
예제 #3
0
        private void RenderButton(MapGraphics g, PanelButton button)
        {
            float markerLength = this.Pointer.MarkerLength;

            markerLength = (float)(markerLength + 5.0);
            float  num  = 0f;
            float  num2 = 0f;
            float  relativeY;
            float  num3;
            PointF relative;
            float  relativeX;

            if (this.GetOrientation() == Orientation.Horizontal)
            {
                relativeY    = (float)((100.0 - markerLength) / 2.0);
                relativeY    = g.GetRelativeX(g.GetAbsoluteY(relativeY));
                markerLength = g.GetRelativeX(g.GetAbsoluteY(markerLength));
                num3         = g.GetAbsoluteX(markerLength);
                relative     = new PointF((float)(markerLength / 2.0 + relativeY), 50f);
                if (button.Type == PanelButtonType.ZoomOut && this.GetReversed())
                {
                    goto IL_00a1;
                }
                if (button.Type == PanelButtonType.ZoomButton && !this.GetReversed())
                {
                    goto IL_00a1;
                }
            }
            else
            {
                relativeX    = (float)((100.0 - markerLength) / 2.0);
                relativeX    = g.GetRelativeY(g.GetAbsoluteX(relativeX));
                markerLength = g.GetRelativeY(g.GetAbsoluteX(markerLength));
                num3         = g.GetAbsoluteY(markerLength);
                relative     = new PointF(50f, (float)(markerLength / 2.0 + relativeX));
                if (button.Type == PanelButtonType.ZoomOut && !this.GetReversed())
                {
                    goto IL_0126;
                }
                if (button.Type == PanelButtonType.ZoomButton && this.GetReversed())
                {
                    goto IL_0126;
                }
            }
            goto IL_0138;
IL_00a1:
            num = (float)(100.0 - markerLength - 2.0 * relativeY);
            goto IL_0138;
IL_0126:
            num2 = (float)(100.0 - markerLength - 2.0 * relativeX);
            goto IL_0138;
IL_0138:
            relative.X += num;
            relative.Y += num2;
            relative    = g.GetAbsolutePoint(relative);
            RectangleF absolute = new RectangleF(relative.X, relative.Y, 0f, 0f);

            absolute.Inflate((float)(num3 / 2.0), (float)(num3 / 2.0));
            button.Bounds = g.GetRelativeRectangle(absolute);
            button.Render(g);
        }