Skip to content

Commit 50e5dc7

Browse files
committed
Fix - do not adjust Y range of TH1 if was fixed
1 parent 626471c commit 50e5dc7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

modules/hist2d/TH1Painter.mjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class TH1Painter extends THistPainter {
132132
}
133133

134134
// final adjustment like in THistPainter.cxx line 7309
135-
if (!this._exact_y_range && !pad_logy) {
135+
if (!this._exact_y_range && !this._set_y_range && !pad_logy) {
136136
if ((this.options.BaseLine !== false) && (this.ymin >= 0))
137137
this.ymin = 0;
138138
else {
@@ -156,17 +156,22 @@ class TH1Painter extends THistPainter {
156156
}
157157
}
158158

159+
this._set_y_range = false;
160+
159161
if ((hmin !== kNoZoom) && (hmax !== kNoZoom) && !this.draw_content &&
160162
((this.ymin === this.ymax) || (this.ymin > hmin) || (this.ymax < hmax))) {
161163
this.ymin = hmin;
162164
this.ymax = hmax;
165+
this._set_y_range = true;
163166
} else {
164167
if (hmin !== kNoZoom) {
168+
this._set_y_range = true;
165169
if (hmin < this.ymin)
166170
this.ymin = hmin;
167171
set_zoom = true;
168172
}
169173
if (hmax !== kNoZoom) {
174+
this._set_y_range = true;
170175
if (hmax > this.ymax)
171176
this.ymax = hmax;
172177
set_zoom = true;

0 commit comments

Comments
 (0)