Skip to content

Commit 92d4769

Browse files
committed
Fix - better interactive zooming in color palette
1 parent cf03921 commit 92d4769

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

changes.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# JSROOT changelog
22

3+
## Changes in 5.9.x
4+
1. Fix zooming in color palette
5+
6+
37
## Changes in 5.9.0
48
1. Support RX and RY drawing option together with COL of TH2
59
2. Add support of #overline, #underline, #strike into TLatex parsing (#196)

scripts/JSRootPainter.hist.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -952,9 +952,9 @@
952952
d3.event.preventDefault();
953953
var m = d3.mouse(evnt);
954954

955-
if (m[1] < sel1) sel1 = m[1]; else sel2 = m[1];
955+
sel2 = Math.min(Math.max(m[1], 0), s_height);
956956

957-
zoom_rect.attr("y", sel1)
957+
zoom_rect.attr("y", Math.min(sel1,sel2))
958958
.attr("height", Math.abs(sel2-sel1));
959959
}
960960

@@ -993,7 +993,7 @@
993993
.attr("x", "0")
994994
.attr("width", s_width)
995995
.attr("y", sel1)
996-
.attr("height", 5);
996+
.attr("height", 1);
997997

998998
d3.select(window).on("mousemove.colzoomRect", moveRectSel)
999999
.on("mouseup.colzoomRect", endRectSel, true);

0 commit comments

Comments
 (0)