Merge pull request #1709 from ONLYOFFICE/fix/bugfix

Fix/bugfix
This commit is contained in:
Julia Radzhabova 2022-04-20 10:54:44 +03:00 committed by GitHub
commit e7f97aabf2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 6 deletions

View file

@ -106,6 +106,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
this.api = this.options.api; this.api = this.options.api;
this._changedProps = null; this._changedProps = null;
this._changedShapeProps = null; this._changedShapeProps = null;
this._isSmartArt = false;
}, },
render: function() { render: function() {
@ -253,7 +254,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
minValue: 0 minValue: 0
}); });
this.spnShapeWidth.on('change', _.bind(function(field, newValue, oldValue, eOpts){ this.spnShapeWidth.on('change', _.bind(function(field, newValue, oldValue, eOpts){
if (this.chRatio.getValue()=='checked' && !this.chRatio.isDisabled()) { if (this.chRatio.getValue()=='checked' && (!this.chRatio.isDisabled() || this._isSmartArt)) {
var w = field.getNumberValue(); var w = field.getNumberValue();
var h = w/this._nRatio; var h = w/this._nRatio;
if (h>this.sizeMax.height) { if (h>this.sizeMax.height) {
@ -281,7 +282,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
}); });
this.spnShapeHeight.on('change', _.bind(function(field, newValue, oldValue, eOpts){ this.spnShapeHeight.on('change', _.bind(function(field, newValue, oldValue, eOpts){
var h = field.getNumberValue(), w = null; var h = field.getNumberValue(), w = null;
if (this.chRatio.getValue()=='checked' && !this.chRatio.isDisabled()) { if (this.chRatio.getValue()=='checked' && (!this.chRatio.isDisabled() || this._isSmartArt)) {
w = h * this._nRatio; w = h * this._nRatio;
if (w>this.sizeMax.width) { if (w>this.sizeMax.width) {
w = this.sizeMax.width; w = this.sizeMax.width;
@ -1408,7 +1409,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
this._setShapeDefaults(shapeprops); this._setShapeDefaults(shapeprops);
this.setTitle(this.textTitleShape); this.setTitle(this.textTitleShape);
value = props.asc_getLockAspect(); value = props.asc_getLockAspect();
this.chRatio.setValue(value); this.chRatio.setValue(value || this._isSmartArt, true); // can resize smart art only proportionately
this.spnShapeWidth.setMaxValue(this.sizeMax.width); this.spnShapeWidth.setMaxValue(this.sizeMax.width);
this.spnShapeHeight.setMaxValue(this.sizeMax.height); this.spnShapeHeight.setMaxValue(this.sizeMax.height);
@ -1450,7 +1451,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
value = props.get_Height(); value = props.get_Height();
this.spnShapeHeight.setValue((value!==undefined) ? Common.Utils.Metric.fnRecalcFromMM(value).toFixed(2) : '', true); this.spnShapeHeight.setValue((value!==undefined) ? Common.Utils.Metric.fnRecalcFromMM(value).toFixed(2) : '', true);
} }
this.chRatio.setDisabled(this.radioVSizePc.getValue() || this.radioHSizePc.getValue()); this.chRatio.setDisabled(this.radioVSizePc.getValue() || this.radioHSizePc.getValue() || this._isSmartArt);
var margins = shapeprops.get_paddings(); var margins = shapeprops.get_paddings();
if (margins) { if (margins) {
@ -1558,11 +1559,13 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
this.radioHSizePc.setDisabled(true); this.radioHSizePc.setDisabled(true);
this.radioVSizePc.setDisabled(true); this.radioVSizePc.setDisabled(true);
this.btnsCategory[2].setDisabled(true); this.btnsCategory[2].setDisabled(true);
this._isSmartArt = true;
} }
if (props.get_FromSmartArtInternal()) { if (props.get_FromSmartArtInternal()) {
this.chAutofit.setDisabled(true); this.chAutofit.setDisabled(true);
this.chFlipHor.setDisabled(true); this.chFlipHor.setDisabled(true);
this.chFlipVert.setDisabled(true); this.chFlipVert.setDisabled(true);
this.btnsCategory[1].setDisabled(true);
} }
var stroke = props.get_stroke(); var stroke = props.get_stroke();

View file

@ -578,6 +578,7 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem
this.radioFit.setDisabled(true); this.radioFit.setDisabled(true);
this.chFlipHor.setDisabled(true); this.chFlipHor.setDisabled(true);
this.chFlipVert.setDisabled(true); this.chFlipVert.setDisabled(true);
this.btnsCategory[0].setDisabled(true);
} }
this.spnWidth.setValue(Common.Utils.Metric.fnRecalcFromMM(props.get_Width()).toFixed(2), true); this.spnWidth.setValue(Common.Utils.Metric.fnRecalcFromMM(props.get_Width()).toFixed(2), true);
@ -587,7 +588,8 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem
this._nRatio = props.get_Width()/props.get_Height(); this._nRatio = props.get_Width()/props.get_Height();
var value = props.asc_getLockAspect(); var value = props.asc_getLockAspect();
this.btnRatio.toggle(value); this.btnRatio.toggle(value || props.get_FromSmartArt());
this.btnRatio.setDisabled(!!props.get_FromSmartArt()); // can resize smart art only proportionately
this._setShapeDefaults(props); this._setShapeDefaults(props);

View file

@ -637,6 +637,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ShapeSettingsAdvanced.temp
this.chOverflow.setDisabled(true); this.chOverflow.setDisabled(true);
this.chFlipHor.setDisabled(true); this.chFlipHor.setDisabled(true);
this.chFlipVert.setDisabled(true); this.chFlipVert.setDisabled(true);
this.btnsCategory[0].setDisabled(true);
} }
this.spnWidth.setValue(Common.Utils.Metric.fnRecalcFromMM(props.asc_getWidth()).toFixed(2), true); this.spnWidth.setValue(Common.Utils.Metric.fnRecalcFromMM(props.asc_getWidth()).toFixed(2), true);
@ -646,7 +647,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ShapeSettingsAdvanced.temp
this._nRatio = props.asc_getWidth()/props.asc_getHeight(); this._nRatio = props.asc_getWidth()/props.asc_getHeight();
var value = props.asc_getLockAspect(); var value = props.asc_getLockAspect();
this.btnRatio.toggle(value); this.btnRatio.toggle(value || shapeprops.asc_getFromSmartArt());
this.btnRatio.setDisabled(!!shapeprops.asc_getFromSmartArt()); // can resize smart art only proportionately
this._setShapeDefaults(shapeprops); this._setShapeDefaults(shapeprops);