示例#1
0
        public override void Draw(DrawingContext drawingContext, float scale, float x, float y)
        {
            base.Draw(drawingContext, scale, x, y);
            float padding = margin ? TEXConfiguration.main.LinkMargin : 0;

            var tint = drawingContext.DrawLink(
                new Rect((x - padding / 2f) * scale, (y - depth - padding / 2f) * scale,
                         (width + padding) * scale, (totalHeight + padding) * scale), metaKey);

            TexContext.Color.Push(TexUtility.MultiplyColor(TexContext.Color.value, tint));
            baseBox.Draw(drawingContext, scale, x, y);
            TexContext.Color.Pop();
        }
示例#2
0
        public override void Draw(DrawingContext drawingContext, float scale, float x, float y)
        {
            base.Draw(drawingContext, scale, x, y);

            var curY  = y + height;
            var count = children.Count;

            if (ExtensionMode)
            {
                float offset = TEXConfiguration.main.ExtentPadding;
                for (int i = 0; i < count; i++)
                {
                    Box child = children[i];
                    curY -= child.height;
                    if (i > 0)
                    {
                        child.height += offset;
                    }
                    if (i < count - 1)
                    {
                        child.depth += offset;
                    }
                    child.Draw(drawingContext, scale, x + child.shift - leftMostPos, curY);
                    if (i > 0)
                    {
                        child.height -= offset;
                    }
                    if (i < count - 1)
                    {
                        child.depth -= offset;
                    }
                    curY -= child.depth;
                }
            }
            else
            {
                for (int i = 0; i < count; i++)
                {
                    Box child = children[i];
                    curY -= child.height;
                    child.Draw(drawingContext, scale, x + child.shift - leftMostPos, curY);
                    curY -= child.depth;
                }
            }
        }