The settings xml tree is generated using `WRITE_*` macros. In fact, they
do not write a settings item out but save/store a node in the xml tree,
before finally writing out a textual representation of the tree. In
particular, `WRITE_COMMENT` adds/attaches a node to the previously saved
node and typically ends up before that in the textual representation.
Rename them to `ATTACH_COMMENT` resp. `SAVE_*` to avoid confusion and to
name them more inline with the underlying functions.
The comments for `scrollbarHideType` and for new pages are misplaced in
`settings.xml`, for two different reasons: comments arise as nodes
attached to the node which they comment on in the tree but are output
before the node in a textual representation. Therefore, the code
generating the tree can generate a node comment only after the node it
comments on (1st reason). The usage of macros hides this fact, so when
you circumvent the macros you have to assign the node variable manually,
or else the comment will be attached to the wrong node (2nd reason).
Fix both.
From its inception, the ini file specified a default grid parameter (20)
which was different from the default in the source code (which coincides
with the default for graph paper, 14.17).
Remove the default from the ini file so that the ini file is free from
any extra parameters.
This does not change how existing files are displayed since they store
any extra parameters for the page templates. It does change how new
files with isometric paper background look: they use the narrower
spacing 14.17 and do not store it in the file, unless a user specifies
the parameter in the ini file explicitely.
The page templates ini file specifies some unnecessary parameters (equal
to the default) and some template names incosistent with the page style
name.
Clean this up, and while at it also the spelling of a related variable
and some old page style names in test files.
No functional change.
For grid painting, the paper is divided into an integer number of cols
and rows. The isometric grid uses only every other point in the grid to
produce the hexagonal lattice. "Isometric dotted" simply stops painting
outside of the paper, but "isometric graph" has to compute the starting
and ending points of the diagonals (and the verticals).
Currently, this works correctly only for the case of an even number of
cols and rows. In all other cases, the right and/or bottom end of the
diagonals are off by 1 grid unit which gives them a wrong slope.
Consequently, not all graph lines intersect as they should.
The simple fix would ensure that cols and rows are always even,
leading to a change in grid layout and a difference between "dotted" and
"graph" versions.
Fix this by taking into account the difference between cols and 2*hdiags
(with hdiags=floor(cols/2) and anologously for the vertical spacing.
This ensures that "dotted" and "graph" versions match exactly.
The existing implementation has the first top left diagonal go from
(0,1) to (1,0) in grid coordinates. As a consequence, there is one more
diagonal in the odd-odd case then in the other cases. We keep in line
with the existing implementation and take care of that extra diagonal
when needed.