Skip to content

Commit

Permalink
[bug] fix scale in mobile view
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyLuzyanin committed Feb 3, 2025
1 parent be6ade6 commit 4f43d3e
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common/apiBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -5195,7 +5195,7 @@
return this.canRemoveAllInks();
};
baseEditorsApi.prototype.canRemoveAllInks = function() {
return true;
return this.haveInks();
};
baseEditorsApi.prototype.stopInkDrawer = function() {
this.inkDrawer.turnOff();
Expand Down
9 changes: 8 additions & 1 deletion slide/Drawing/Transitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3821,7 +3821,14 @@ function CDemonstrationManager(htmlpage)
}
case 27: // escape
{
oThis.End();
if(Asc.editor.isInkDrawerOn())
{
Asc.editor.stopInkDrawer();
}
else
{
Asc.editor.EndDemonstration();
}
break;
}
case 48: // 0
Expand Down
8 changes: 8 additions & 0 deletions word/Editor/Document.js
Original file line number Diff line number Diff line change
Expand Up @@ -6331,6 +6331,14 @@ CDocument.prototype.PutImageToSelection = function(sImageSrc, nWidth, nHeight, r
return this.DrawingObjects.putImageToSelection(sImageSrc, nWidth, nHeight, replaceMode);

};
CDocument.prototype.RemoveAllInks = function()
{
return this.DrawingObjects.removeAllInks();
};
CDocument.prototype.HaveInks = function()
{
return this.DrawingObjects.haveInks();
};
/**
* Добавляем таблицу в текущую позицию курсора
* @param {number} nCols
Expand Down
36 changes: 36 additions & 0 deletions word/Editor/GraphicObjects/GraphicObjects.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,42 @@ CGraphicObjects.prototype =
createWatermarkImage: DrawingObjectsController.prototype.createWatermarkImage,


getAllInksDrawings: function ()
{
let aDrawings = this.document.GetAllDrawingObjects();
let aInksDrawings = [];
for(let nIdx = 0; nIdx < aDrawings.length; ++nIdx)
{
let oDrawing = aDrawings[nIdx];
if(oDrawing.GraphicObj.isInk())
{
aInksDrawings.push(oDrawing);
}
}
return aInksDrawings;
},
haveInks: function ()
{
return this.getAllInksDrawings().length > 0;
},
removeAllInks: function ()
{
let aInksDrawings = this.getAllInksDrawings();
if(aInksDrawings.length > 0)
{
this.document.StartAction(0);
for(let nIdx = 0; nIdx < aInksDrawings.length; ++nIdx)
{
let oDrawing = aInksDrawings[nIdx];
oDrawing.Remove_FromDocument(false);
this.deselectObject(oDrawing.GraphicObj);
}
this.document.Recalculate();
this.document.FinalizeAction();
}
},


createWatermark: function(oProps)
{
if(oProps.get_Type() === Asc.c_oAscWatermarkType.None)
Expand Down
4 changes: 3 additions & 1 deletion word/Editor/Paragraph/ParaDrawing.js
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,9 @@ ParaDrawing.prototype.CheckWH = function()
extY = 5;
rot = 0;
}
this.setExtent(extX, extY);

let dKoef = this.GetScaleCoefficient();
this.setExtent(extX / dKoef, extY / dKoef);


var EEL = 0.0, EET = 0.0, EER = 0.0, EEB = 0.0;
Expand Down
14 changes: 14 additions & 0 deletions word/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -13595,6 +13595,20 @@ background-repeat: no-repeat;\
return bReset;
};

asc_docs_api.prototype.removeAllInks = function()
{
let oLogicDocument = this.getLogicDocument();
if(!oLogicDocument) return;
return oLogicDocument.RemoveAllInks();
};


asc_docs_api.prototype.haveInks = function() {
let oLogicDocument = this.getLogicDocument();
if(!oLogicDocument) return;
return oLogicDocument.HaveInks();
};

asc_docs_api.prototype.onUpdateRestrictions = function(restrictionSettings)
{
if (this.WordControl)
Expand Down

0 comments on commit 4f43d3e

Please sign in to comment.