diff --git a/src/flamegraph/flamegraph.css b/src/flamegraph/flamegraph.css index 0bc41840..42e9d535 100644 --- a/src/flamegraph/flamegraph.css +++ b/src/flamegraph/flamegraph.css @@ -1,4 +1,5 @@ -#search { opacity:0.1; cursor:pointer; } +#matched { text-anchor:end; } +#search { text-anchor:end; opacity:0.1; cursor:pointer; } #search:hover, #search.show { opacity:1; } #subtitle { text-anchor:middle; font-color:rgb(160,160,160); } #unzoom { cursor:pointer; } diff --git a/src/flamegraph/flamegraph.js b/src/flamegraph/flamegraph.js index cf53d99a..fae5f553 100644 --- a/src/flamegraph/flamegraph.js +++ b/src/flamegraph/flamegraph.js @@ -40,8 +40,8 @@ function init(evt) { // Keep search elements at a fixed distance from right edge. var svgWidth = svg.width.baseVal.value; - searchbtn.attributes.x.value = svgWidth - xpad - 100; - matchedtxt.attributes.x.value = svgWidth - xpad - 100; + searchbtn.attributes.x.value = svgWidth - xpad; + matchedtxt.attributes.x.value = svgWidth - xpad; }; window.addEventListener('resize', function() { update_for_width_change(); diff --git a/src/flamegraph/svg.rs b/src/flamegraph/svg.rs index bf57475b..79b7f024 100644 --- a/src/flamegraph/svg.rs +++ b/src/flamegraph/svg.rs @@ -244,7 +244,7 @@ text {{ font-family:{}; font-size:{}px; fill:rgb(0,0,0); }} svg, &mut buf, TextItem { - x: Dimension::Pixels(image_width as usize - super::XPAD - 100), + x: Dimension::Pixels(image_width as usize - super::XPAD), y: (opt.font_size * 2) as f64, text: "Search".into(), extra: vec![("id", "search")], @@ -255,7 +255,7 @@ text {{ font-family:{}; font-size:{}px; fill:rgb(0,0,0); }} svg, &mut buf, TextItem { - x: Dimension::Pixels(image_width as usize - super::XPAD - 100), + x: Dimension::Pixels(image_width as usize - super::XPAD), y: (style_options.imageheight - (opt.ypad2() / 2)) as f64, text: " ".into(), extra: iter::once(("id", "matched")), diff --git a/tests/data/flamegraph/austin/flame.svg b/tests/data/flamegraph/austin/flame.svg index d19591cc..63b4564e 100644 --- a/tests/data/flamegraph/austin/flame.svg +++ b/tests/data/flamegraph/austin/flame.svg @@ -10,7 +10,8 @@