Skip to content

Commit

Permalink
Fixed arrowhead changes after SVG download.
Browse files Browse the repository at this point in the history
The arrowheads were changing from filled to not filled after the
download button was clicked. The problem comes from the
getComputedStyles function, which seems to convert a fill of #000 to a
fill of auto with an opacity of rgb(0,0,0). This doesn't get passed back
to the constructed SVG and so the correct arrowhead is not drawn. To fix
it I changed the color from #000 to #111 and the correct fill value is
assigned to the downloaded SVG. Nobody will notice the difference
between #000 and #111 on a normal monitor, so we should be fine.
  • Loading branch information
neomorphic committed Aug 31, 2015
1 parent f38f7dc commit 48464d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -267,3 +267,7 @@ text {
.node, .edgePath:focus {
outline: none;
}

#arrowhead15 path {
fill: #111;
}
4 changes: 2 additions & 2 deletions js/components/RepoDAG.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ var RepoDAG = React.createClass({
$.each(n.Children, function (c) {
dag.setEdge(version, n.Children[c], {
lineInterpolate: 'basis',
arrowheadStyle: "fill: #000",
arrowheadStyle: "fill: #111",
id: version + "-" + n.Children[c]
});
});
Expand Down Expand Up @@ -427,7 +427,7 @@ function expand(parent, collapsedChildren) {
dag.setEdge(parent, child, {
lineInterpolate: 'basis',
id: parent + "-" + child,
arrowheadStyle: "fill: #000",
arrowheadStyle: "fill: #111",
});
//NOT a typo! only the parent's immediate collapsed children are expanded.
//the parent's children's expanded children (not collapsed children) are expanded for the rest of the graph.
Expand Down

0 comments on commit 48464d8

Please sign in to comment.