From 48464d83c86d674b7a930113d27bd407f6fdbe80 Mon Sep 17 00:00:00 2001 From: Jody Clements Date: Mon, 31 Aug 2015 16:49:33 -0400 Subject: [PATCH] Fixed arrowhead changes after SVG download. 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. --- css/app.css | 4 ++++ js/components/RepoDAG.react.js | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/css/app.css b/css/app.css index 34e77fa..a39f4b6 100644 --- a/css/app.css +++ b/css/app.css @@ -267,3 +267,7 @@ text { .node, .edgePath:focus { outline: none; } + +#arrowhead15 path { + fill: #111; +} diff --git a/js/components/RepoDAG.react.js b/js/components/RepoDAG.react.js index fbf024e..76a2ea9 100644 --- a/js/components/RepoDAG.react.js +++ b/js/components/RepoDAG.react.js @@ -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] }); }); @@ -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.