split out default attribute setting and size adjustment into separate functions #42
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This has been on the 'to-do' list for a while, but we actually just discovered a bug in the cairo/gtk backend that needs this to be fixed. The GTK backend has an option to skip the adjustments -- in order to have better control over the coordinates used etc. (for dealing with mouse clicks and so on). However, since we were conflating size adjustment and default coordinate setting, the bypass mode also bypassed setting default attributes, leading to things like lines being mistakenly drawn using the fill color, etc. (A patch for the cairo backend will follow separately.)
This patch just splits the functionality of
adjustDia2D
into two separate functions. The semantics ofadjustDia2D
itself should be unchanged, so this will not break any existing code; it just makes it possible to invoke only parts of it as necessary.