Thomas Hoevel wrote:
Sections inherit properties from the previous sections unless they are overridden.
If you need a header for the first section but do not want a header for the second section, set a new, empty header for section 2. Section 3 will have the same header as section 2 unless you make any changes.
This is useful to know, thanks.
Also I have discovered what appears to be a bug with how LineFormat property for the TextFrame is rendered. I was using it as a border around some text when I noticed that it didn't appear to quite a line up with what it was bordering. Some quick research found that issue was reported here in 2010:
viewtopic.php?f=3&t=1346It has evidently not been fixed (for reference I am working using WPF). I noticed that the content area of the frame that was sticking out on the bottom and right sides appeared to each be half the size of the line's width. I did my best to try and dig into this and find out what was happening and will try and explain things based on what I've observed.
When the LineFormat property is rendered, I believe it is drawn as a rectangle. When rendered, its (0,0) coordinates are treated as being in the centre of it. However, the code used to position the line treats it as though the line's (0,0) coordinates will be its top left. Thus when the line is eventually rendered around the content area, it will be mis-aligned by half the width of the line, as you can see in the image in the thread linked above.
In investigating this, I encountered the RenderLine() method in ShapeRenderer.cs, which when calculating the position of the line, treats it as if it's rendering with the consideration that the line's (0,0) coordinates are at the top-left of it (and thus the full width of the line is subtracted from the height and width of the content area with the presumed intention being that the line will render inside of the content area on the right and bottom sides, but align with the edge of the content area so that the content area doesn't poke out).
To correct this, I modified the RenderLine() method in ShapeRenderer.cs and changed
Code:
XUnit width = contentArea.Width - lineWidth;
XUnit height = contentArea.Height - lineWidth;
To be:
Code:
XUnit width = contentArea.Width - (lineWidth/2);
XUnit height = contentArea.Height - (lineWidth/2);
Thus making the fixed method look like the following:
Code:
protected void RenderLine()
{
Area contentArea = this.renderInfo.LayoutInfo.ContentArea;
XUnit lineWidth = this.lineFormatRenderer.GetWidth();
XUnit width = contentArea.Width - (lineWidth/2);
XUnit height = contentArea.Height - (lineWidth/2);
this.lineFormatRenderer.Render(contentArea.X, contentArea.Y, width, height);
}
Now I don't know if this is the correct way to fix what's wrong here; maybe the line is supposed to be rendering with its (0,0) coordinates being considered as its top-left rather than its centre, in which case it's not this area of the code that needs changing, but something else to do with the actual rendering of the line.
However, for now this correction serves my purposes, and I leave the code above for anyone else who happens to encounter this problem, assuming it continues to go without an official fix being released.