Skip to content

Commit cf2efe1

Browse files
committed
Merge pull request #17 from bellenot/master
Set the zoom values only if they are different than the axes values I will slightly change condition with next commit
2 parents c9ea88e + f802898 commit cf2efe1

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

scripts/JSRootPainter.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3970,16 +3970,20 @@
39703970
this['zoom_zmax'] = 0;
39713971

39723972
if ((pad!=null) && ('fUxmin' in pad) && !this.create_canvas) {
3973-
this['zoom_xmin'] = pad.fUxmin;
3974-
this['zoom_xmax'] = pad.fUxmax;
3975-
this['zoom_ymin'] = pad.fUymin;
3976-
this['zoom_ymax'] = pad.fUymax;
3977-
3973+
if (pad.fUxmin !== this['histo']['fXaxis']['fXmin'] &&
3974+
pad.fUxmax !== this['histo']['fXaxis']['fXmax']) {
3975+
this['zoom_xmin'] = pad.fUxmin;
3976+
this['zoom_xmax'] = pad.fUxmax;
3977+
}
3978+
if (pad.fUymin !== this['histo']['fYaxis']['fXmin'] &&
3979+
pad.fUymax !== this['histo']['fYaxis']['fXmax']) {
3980+
this['zoom_ymin'] = pad.fUymin;
3981+
this['zoom_ymax'] = pad.fUymax;
3982+
}
39783983
if (pad.fLogx > 0) {
39793984
this['zoom_xmin'] = Math.exp(this['zoom_xmin'] * Math.log(10));
39803985
this['zoom_xmax'] = Math.exp(this['zoom_xmax'] * Math.log(10));
39813986
}
3982-
39833987
if (pad.fLogy > 0) {
39843988
this['zoom_ymin'] = Math.exp(this['zoom_ymin'] * Math.log(10));
39853989
this['zoom_ymax'] = Math.exp(this['zoom_ymax'] * Math.log(10));

0 commit comments

Comments
 (0)