From f221c7658b0540232fddc532b8809c5c850ee6d2 Mon Sep 17 00:00:00 2001 From: Sergey Luzyanin Date: Sat, 14 Feb 2026 19:59:31 +0300 Subject: [PATCH] [bug] fix bug 80014 --- common/Charts/DrawingObjects.js | 17 +++++++++++++---- common/Drawings/States.js | 4 ++-- common/Drawings/TrackObjects/MoveTracks.js | 15 +++++++++++---- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/common/Charts/DrawingObjects.js b/common/Charts/DrawingObjects.js index abfdb8f61d..672130f523 100644 --- a/common/Charts/DrawingObjects.js +++ b/common/Charts/DrawingObjects.js @@ -1885,7 +1885,8 @@ CSparklineView.prototype.setMinMaxValAx = function(minVal, maxVal, oSparklineGro var ScrollOffset = function() { this.getX = function() { - return 2 * worksheet._getColLeft(0) - worksheet._getColLeft(worksheet.getFirstVisibleCol(true)); + var val = 2 * worksheet._getColLeft(0) - worksheet._getColLeft(worksheet.getFirstVisibleCol(true)); + return worksheet.getRightToLeft() ? -val : val; }; this.getY = function() { @@ -3855,9 +3856,17 @@ CSparklineView.prototype.setMinMaxValAx = function(minVal, maxVal, oSparklineGro response.result = false; response.y = Math.abs(y); } - if ( x < 0 ) { - response.result = false; - response.x = Math.abs(x); + if (worksheet.getRightToLeft()) { + var maxX = pxToMm(worksheet.getCtxWidth()); + if (x + w > maxX) { + response.result = false; + response.x = maxX - x - w; // negative → pushes shape left + } + } else { + if ( x < 0 ) { + response.result = false; + response.x = Math.abs(x); + } } return response; diff --git a/common/Drawings/States.js b/common/Drawings/States.js index 8bd02d7536..1384ccd0c2 100644 --- a/common/Drawings/States.js +++ b/common/Drawings/States.js @@ -1878,8 +1878,8 @@ function MoveInGroupState(drawingObjects, majorObject, group, startX, startY) } this.rectX = Math.min.apply(Math, arr_x); this.rectY = Math.min.apply(Math, arr_y); - this.rectW = Math.max.apply(Math, arr_x); - this.rectH = Math.max.apply(Math, arr_y); + this.rectW = Math.max.apply(Math, arr_x) - this.rectX; + this.rectH = Math.max.apply(Math, arr_y) - this.rectY; } MoveInGroupState.prototype = diff --git a/common/Drawings/TrackObjects/MoveTracks.js b/common/Drawings/TrackObjects/MoveTracks.js index cbd0d6deae..29be77edf8 100644 --- a/common/Drawings/TrackObjects/MoveTracks.js +++ b/common/Drawings/TrackObjects/MoveTracks.js @@ -383,10 +383,17 @@ function MoveShapeImageTrack(originalObject) { _xfrm.setOffX(this.x/scale_coefficients.cx + ch_off_x); _xfrm.setOffY(this.y/scale_coefficients.cy + ch_off_y); - if (Asc.editor.getEditorId() === AscCommon.c_oEditorId.Spreadsheet) - Asc.editor.addMacroStepData("SetDrawingPos", {from: this.originalObject.drawingBase.from, to: this.originalObject.drawingBase.to}); - if (Asc.editor.getEditorId() === AscCommon.c_oEditorId.Presentation) - Asc.editor.addMacroStepData("SetDrawingPos", {x: this.x, y: this.y}); + + if (!this.originalObject.group) { + if (Asc.editor.getEditorId() === AscCommon.c_oEditorId.Spreadsheet) { + let drawingBase = this.originalObject.drawingBase; + if (drawingBase) { + Asc.editor.addMacroStepData("SetDrawingPos", {from: drawingBase.from, to: drawingBase.to}); + } + } + if (Asc.editor.getEditorId() === AscCommon.c_oEditorId.Presentation) + Asc.editor.addMacroStepData("SetDrawingPos", {x: this.x, y: this.y}); + } if (this.originalObject.txXfrm) { var previousTxXfrmX = this.originalObject.txXfrm.offX;