-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Significant Painter API and SVG rendering changes
Changes put together because both required significant changes to the SVG validation in tests. These changes were carefully examined to make sure there were no negative visual issues. **Painter API changes**: The Painter API can be confusing, with some functions depending on the state of the painter. This changes the Painter API (internal and external) so that style attributes (ie FillColor, StrokeColor, StrokeWidth, etc) are not stateful. Instead the relevant style values are accepted as arguments to the draw action. This creates an easier to use API. It also addresses a complexity if multiple Child painters are used together with different drawing state. Test SVG's resulted from two primary aspects of this change: * Measuring text not representing the actual text size due to the font style not set correctly in the Painter * A fill style attribute being specified when it has no effect (since style was set due to prior operations) In general the exposed functions were general examined to ensure all exposed functions are both useful, and easy to use. This resulted in a number of argument changes, which should be detailed in the go docs. **vector_renderer (SVG) improvements**: This change minimizes and simplifies the SVG output through the following: * If stroke width is zero, or the color is transparent only `stroke:none` will be set, instead of the prior `stroke-width:0;stroke:none` value * Colors will be specified by name if possible, otherwise an RGB or RGBA string will still be used * If the text or path is empty, nothing will be inserted into the svg. These three changes reduce the SVG size. Specifying the color names could potentially allow color shade changes using CSS. As a bonus, additional colors are now specified in the `drawing` package. ---- SVG changes are always painful, these were careful evaluated to ensure this is an improvement in both the Painter functionality and SVG results.
- Loading branch information
Showing
37 changed files
with
833 additions
and
793 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.