OffsetCanvasOriginX() public method

public OffsetCanvasOriginX ( int dx ) : void
dx int
return void
        public override void DrawChildContent(Canvas canvas, Rectangle updateArea)
        {
            if ((layerFlags & IS_LAYER_HIDDEN) != 0)
            {
                return;
            }

            this.BeginDrawingChildContent();
            if ((layerFlags & FLOWLAYER_HAS_MULTILINE) != 0)
            {
                List<EditableTextLine> lines = (List<EditableTextLine>)lineCollection;
                int renderAreaTop = updateArea.Top;
                int renderAreaBottom = updateArea.Bottom;
                bool foundFirstLine = false;
                int j = lines.Count;
                for (int i = 0; i < j; ++i)
                {
                    EditableTextLine line = lines[i];
#if DEBUG
                    if (this.OwnerRenderElement is RenderBoxBase)
                    {
                        debug_RecordLineInfo((RenderBoxBase)OwnerRenderElement, line);
                    }
#endif

                    int y = line.Top;
                    LinkedListNode<EditableRun> curNode = line.First;
                    if (!foundFirstLine)
                    {
                        if (y + line.ActualLineHeight < renderAreaTop)
                        {
                            continue;
                        }
                        else
                        {
                            foundFirstLine = true;
                        }
                    }
                    else
                    {
                        if (y > renderAreaBottom)
                        {
                            break;
                        }
                    }

                    updateArea.OffsetY(-y);
                    canvas.OffsetCanvasOriginY(y);
                    while (curNode != null)
                    {
                        EditableRun child = curNode.Value;
                        if (child.IntersectOnHorizontalWith(ref updateArea))
                        {
                            int x = child.X;
                            canvas.OffsetCanvasOriginX(x);
                            updateArea.OffsetX(-x);
                            child.DrawToThisCanvas(canvas, updateArea);
                            canvas.OffsetCanvasOriginX(-x);
                            updateArea.OffsetX(x);
                        }
                        curNode = curNode.Next;
                    }
                    canvas.OffsetCanvasOriginY(-y);
                    updateArea.OffsetY(y);
                }
            }
            else
            {
                EditableTextLine line = (EditableTextLine)lineCollection;
#if DEBUG
                if (OwnerRenderElement is RenderBoxBase)
                {
                    debug_RecordLineInfo((RenderBoxBase)OwnerRenderElement, line);
                }
#endif

                LinkedListNode<EditableRun> curNode = line.First;
                if (curNode != null)
                {
                    int y = line.Top;
                    canvas.OffsetCanvasOriginY(y);
                    updateArea.OffsetY(-y);
                    while (curNode != null)
                    {
                        EditableRun child = curNode.Value;
                        if (child.IntersectOnHorizontalWith(ref updateArea))
                        {
                            int x = child.X;
                            canvas.OffsetCanvasOriginX(x);
                            updateArea.OffsetX(-x);
                            child.DrawToThisCanvas(canvas, updateArea);
                            canvas.OffsetCanvasOriginX(-x);
                            updateArea.OffsetX(x);
                        }
                        curNode = curNode.Next;
                    }
                    canvas.OffsetCanvasOriginY(-y);
                    updateArea.OffsetY(y);
                }
            }
            this.FinishDrawingChildContent();
        }