Edit my bug

This commit is contained in:
OVSharova 2021-07-09 02:59:38 +03:00
parent 8a0ade63f5
commit 8c8a562637
2 changed files with 10 additions and 7 deletions

View file

@ -381,8 +381,8 @@ var metrics = new(function() {
fnRecalcToMM: function(value, unit) {
// value in pt/cm/inch. need to convert to mm
if(unit==undefined)
unrt=me.currentMetric
if(unit===undefined)
unit=me.currentMetric;
if (value!==null && value!==undefined) {
switch (unit) {
case me.c_MetricUnits.cm:
@ -398,8 +398,8 @@ var metrics = new(function() {
fnRecalcFromMM: function(value, unit) {
// value in mm. need to convert to pt/cm/inch
if(unit==undefined)
unrt=me.currentMetric
if(unit===undefined)
unit=me.currentMetric;
switch (unit) {
case me.c_MetricUnits.cm:
return parseFloat((value/10.).toFixed(4));

View file

@ -488,6 +488,7 @@ define([
(this._state.LeftIndent===null || left===null)&&(this._state.LeftIndent!==left)) {
this.numIndentsLeft.setValue(left!==null ? Common.Utils.Metric.fnRecalcFromMM(left) : '', true);
this._state.LeftIndent=left;
}
if ( Math.abs(this._state.FirstLine-first)>0.001 ||
@ -554,12 +555,14 @@ define([
for (var i=0; i<this.spinners.length; i++) {
var spinner = this.spinners[i];
spinner.setDefaultUnit(Common.Utils.Metric.getCurrentMetricName());
if(spinner.el.id == 'paragraph-spin-spacing-before' || spinner.el.id == 'paragraph-spin-spacing-after')
spinner.setDefaultUnit( Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt));
if (spinner.el.id == 'paragraphadv-spin-position' )
spinner.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.01);
else if( spinner.el.id == 'paragraph-spin-spacing-before' || spinner.el.id == 'paragraph-spin-spacing-after')
else if( spinner.el.id == 'paragraph-spin-spacing-before' || spinner.el.id == 'paragraph-spin-spacing-after'){
spinner.setStep(1);
spinner.setDefaultUnit( Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt));
}
else
spinner.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.1);
}