File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -234,12 +234,13 @@ class TF1Painter extends TH1Painter {
234234
235235 /** @summary Checks if it makes sense to zoom inside specified axis range */
236236 canZoomInside ( axis , min , max ) {
237- if ( ( this . $func ?. fSave . length > 0 ) && this . _use_saved_points && ( axis === 'x' ) ) {
237+ const nsave = this . $func ?. fSave . length ?? 0 ;
238+ if ( ( nsave > 3 ) && this . _use_saved_points && ( axis === 'x' ) ) {
238239 // in the case where the points have been saved, useful for example
239240 // if we don't have the user's function
240- const nb_points = this . $func . fNpx ,
241- xmin = this . $func . fSave [ nb_points + 1 ] ,
242- xmax = this . $func . fSave [ nb_points + 2 ] ;
241+ const nb_points = nsave - 2 ,
242+ xmin = this . $func . fSave [ nsave - 2 ] ,
243+ xmax = this . $func . fSave [ nsave - 1 ] ;
243244
244245 return Math . abs ( xmax - xmin ) / nb_points < Math . abs ( max - min ) ;
245246 }
You can’t perform that action at this time.
0 commit comments