@@ -55482,30 +55482,27 @@ class TPadPainter extends ObjectPainter {
5548255482 if (!r.ranges || p.empty()) return true;
5548355483
5548455484 // calculate user range for full pad
55485- const same = x => x,
55486- direct_funcs = [same, Math.log10, x => Math.log10(x)/Math.log10(2)],
55487- revert_funcs = [same, x => Math.pow(10, x), x => Math.pow(2, x)],
55488- match = (v1, v0, range) => (Math.abs(v0-v1) < Math.abs(range)*1e-10) ? v0 : v1,
55489- frect = main.getFrameRect();
55485+ const func = (log, value, err) => {
55486+ if (!log) return value;
55487+ if (value <= 0) return err;
55488+ value = Math.log10(value);
55489+ if (log > 1) value = value/Math.log10(log);
55490+ return value;
55491+ }, frect = main.getFrameRect();
5549055492
55491- let func = direct_funcs[main.logx],
55492- func2 = revert_funcs[main.logx],
55493- k = (func(main.scale_xmax) - func(main.scale_xmin))/frect.width,
55494- x1 = func(main.scale_xmin) - k*frect.x,
55495- x2 = x1 + k*this.getPadWidth();
55493+ r.ux1 = func(main.logx, r.ux1, 0);
55494+ r.ux2 = func(main.logx, r.ux2, 1);
5549655495
55497- r.px1 = match(func2(x1), r.px1, r.ux2-r.ux1);
55498- r.px2 = match(func2(x2), r.px2, r.ux2-r.ux1);
55496+ let k = (r.ux1 - r.ux2)/frect.width;
55497+ r.px1 = r.ux1 - k*frect.x;
55498+ r.px2 = r.px1 + k*this.getPadWidth();
5549955499
55500- func = direct_funcs[ main.logy] ;
55501- func2 = revert_funcs[ main.logy] ;
55500+ r.uy1 = func( main.logy, r.uy1, 0) ;
55501+ r.uy2 = func( main.logy, r.uy2, 1) ;
5550255502
55503- k = (func(main.scale_ymax) - func(main.scale_ymin))/frect.height;
55504- let y2 = func(main.scale_ymax) + k*frect.y,
55505- y1 = y2 - k*this.getPadHeight();
55506-
55507- r.py1 = match(func2(y1), r.py1, r.uy2-r.uy1);
55508- r.py2 = match(func2(y2), r.py2, r.uy2-r.uy1);
55503+ k = (r.uy2 - r.uy1)/frect.height;
55504+ r.py1 = r.uy1 - k*frect.y;
55505+ r.py2 = r.py1 + k*this.getPadHeight();
5550955506
5551055507 return true;
5551155508 }
@@ -91989,10 +91986,10 @@ class TGraphPainter$1 extends ObjectPainter {
9198991986 if ((method.fName == 'RemovePoint') || (method.fName == 'InsertPoint')) {
9199091987 if (!canp || canp._readonly) return true; // ignore function
9199191988
91992- let hint = this.extractTooltip(pnt);
91989+ let pnt = isFunc(pmain?.getLastEventPos) ? pmain.getLastEventPos() : null,
91990+ hint = this.extractTooltip(pnt);
9199391991
9199491992 if (method.fName == 'InsertPoint') {
91995- let pnt = isFunc(pmain.getLastEventPos) ? pmain.getLastEventPos() : null;
9199691993 if (pnt) {
9199791994 let funcs = pmain.getGrFuncs(this.options.second_x, this.options.second_y),
9199891995 userx = funcs.revertAxis('x', pnt.x) ?? 0,
0 commit comments