コード例 #1
0
        protected void ExportSubscript(Graphics graphics, Subscript subscript)
        {
            ExportElement(graphics, subscript.Element1);
            ExportElement(graphics, subscript.Element2);

            if (subscript.DrawConstructionLines)
            {
                DrawConstructionLines(graphics, subscript.Position, subscript.SizeIncludingOuterMargin);
            }
        }
コード例 #2
0
        public void SetSubscriptPosition(Position containerOrigin, Subscript subscript)
        {
            subscript.Position = containerOrigin;

            containerOrigin.X += subscript.LeftWidth;
            containerOrigin.Y += subscript.TopWidth;

            SetElementPosition(containerOrigin, subscript.Element1);

            var marginAdjustment = ChooseLesserLength(subscript.Element1.OuterMargin.Right, subscript.Element2.OuterMargin.Left);

            containerOrigin.X += subscript.Element1.ContentWidth + marginAdjustment;
            containerOrigin.Y += -subscript.TopWidth + subscript.SubscriptOffset;

            SetElementPosition(containerOrigin, subscript.Element2);

            containerOrigin.Y += -subscript.SubscriptOffset;
        }
コード例 #3
0
        public void SetSubscriptSize(Subscript subscript)
        {
            subscript.Element1.FontStyle.FontHeight = subscript.FontStyle.FontHeight;
            subscript.Element2.FontStyle.FontHeight = subscript.FontStyle.FontHeight * subscript.SubscriptScale;

            SetElementSize(subscript.Element1);
            SetElementSize(subscript.Element2);

            var marginAdjustment = GetMarginAdjustment(subscript.Element1, subscript.Element2);

            subscript.SizeOfContent.Width  = subscript.Element1.OuterWidth + subscript.Element2.OuterWidth - marginAdjustment;
            subscript.SizeOfContent.Height = ChooseGreaterLength(subscript.Element1.OuterHeight, subscript.Element2.OuterHeight + subscript.SubscriptOffset);

            SetSizesOfElement(subscript);

            var centreAlignmentPoint = new Position();

            centreAlignmentPoint.X = subscript.OuterWidth / 2;
            centreAlignmentPoint.Y = subscript.Element1.OuterHeight / 2;

            subscript.CentreAlignmentPoint = centreAlignmentPoint;
        }