Fix Bug 38456

This commit is contained in:
Julia Radzhabova 2018-08-10 13:46:19 +03:00
parent f84836fbef
commit ef02ce4ace
3 changed files with 17 additions and 17 deletions

View file

@ -577,14 +577,14 @@ define([
var width = this._state.pgorient ? w : h,
height = this._state.pgorient ? h : w;
if (Math.abs(this._state.pgsize[0] - w) > 0.01 ||
Math.abs(this._state.pgsize[1] - h) > 0.01) {
if (Math.abs(this._state.pgsize[0] - w) > 0.1 ||
Math.abs(this._state.pgsize[1] - h) > 0.1) {
this._state.pgsize = [w, h];
if (this.toolbar.mnuPageSize) {
this.toolbar.mnuPageSize.clearAll();
_.each(this.toolbar.mnuPageSize.items, function(item){
if (item.value && typeof(item.value) == 'object' &&
Math.abs(item.value[0] - width) < 0.01 && Math.abs(item.value[1] - height) < 0.01) {
Math.abs(item.value[0] - width) < 0.1 && Math.abs(item.value[1] - height) < 0.1) {
item.setChecked(true);
return false;
}
@ -600,16 +600,16 @@ define([
right = props.get_RightMargin(),
bottom = props.get_BottomMargin();
if (!this._state.pgmargins || Math.abs(this._state.pgmargins[0] - top) > 0.01 ||
Math.abs(this._state.pgmargins[1] - left) > 0.01 || Math.abs(this._state.pgmargins[2] - bottom) > 0.01 ||
Math.abs(this._state.pgmargins[3] - right) > 0.01) {
if (!this._state.pgmargins || Math.abs(this._state.pgmargins[0] - top) > 0.1 ||
Math.abs(this._state.pgmargins[1] - left) > 0.1 || Math.abs(this._state.pgmargins[2] - bottom) > 0.1 ||
Math.abs(this._state.pgmargins[3] - right) > 0.1) {
this._state.pgmargins = [top, left, bottom, right];
if (this.toolbar.btnPageMargins.menu) {
this.toolbar.btnPageMargins.menu.clearAll();
_.each(this.toolbar.btnPageMargins.menu.items, function(item){
if (item.value && typeof(item.value) == 'object' &&
Math.abs(item.value[0] - top) < 0.01 && Math.abs(item.value[1] - left) < 0.01 &&
Math.abs(item.value[2] - bottom) < 0.01 && Math.abs(item.value[3] - right) < 0.01) {
Math.abs(item.value[0] - top) < 0.1 && Math.abs(item.value[1] - left) < 0.1 &&
Math.abs(item.value[2] - bottom) < 0.1 && Math.abs(item.value[3] - right) < 0.1) {
item.setChecked(true);
return false;
}

View file

@ -201,7 +201,7 @@ define([
height = this.isOrientPortrait ? props.get_H() : props.get_W();
var rec = this.cmbPreset.store.find(function(item){
var size = item.get('size');
return (Math.abs(size[0] - width) < 0.01 && Math.abs(size[1] - height) < 0.01);
return (Math.abs(size[0] - width) < 0.1 && Math.abs(size[1] - height) < 0.1);
});
this.cmbPreset.setValue((rec) ? rec.get('value') : -1);
}

View file

@ -1712,14 +1712,14 @@ define([
onApiPageSize: function(w, h) {
if (this._state.pgorient===undefined) return;
if (Math.abs(this._state.pgsize[0] - w) > 0.01 ||
Math.abs(this._state.pgsize[1] - h) > 0.01) {
if (Math.abs(this._state.pgsize[0] - w) > 0.1 ||
Math.abs(this._state.pgsize[1] - h) > 0.1) {
this._state.pgsize = [w, h];
if (this.toolbar.mnuPageSize) {
this.toolbar.mnuPageSize.clearAll();
_.each(this.toolbar.mnuPageSize.items, function(item){
if (item.value && typeof(item.value) == 'object' &&
Math.abs(item.value[0] - w) < 0.01 && Math.abs(item.value[1] - h) < 0.01) {
Math.abs(item.value[0] - w) < 0.1 && Math.abs(item.value[1] - h) < 0.1) {
item.setChecked(true);
return false;
}
@ -1735,16 +1735,16 @@ define([
right = props.asc_getRight(),
bottom = props.asc_getBottom();
if (!this._state.pgmargins || Math.abs(this._state.pgmargins[0] - top) > 0.01 ||
Math.abs(this._state.pgmargins[1] - left) > 0.01 || Math.abs(this._state.pgmargins[2] - bottom) > 0.01 ||
Math.abs(this._state.pgmargins[3] - right) > 0.01) {
if (!this._state.pgmargins || Math.abs(this._state.pgmargins[0] - top) > 0.1 ||
Math.abs(this._state.pgmargins[1] - left) > 0.1 || Math.abs(this._state.pgmargins[2] - bottom) > 0.1 ||
Math.abs(this._state.pgmargins[3] - right) > 0.1) {
this._state.pgmargins = [top, left, bottom, right];
if (this.toolbar.btnPageMargins.menu) {
this.toolbar.btnPageMargins.menu.clearAll();
_.each(this.toolbar.btnPageMargins.menu.items, function(item){
if (item.value && typeof(item.value) == 'object' &&
Math.abs(item.value[0] - top) < 0.01 && Math.abs(item.value[1] - left) < 0.01 &&
Math.abs(item.value[2] - bottom) < 0.01 && Math.abs(item.value[3] - right) < 0.01) {
Math.abs(item.value[0] - top) < 0.1 && Math.abs(item.value[1] - left) < 0.1 &&
Math.abs(item.value[2] - bottom) < 0.1 && Math.abs(item.value[3] - right) < 0.1) {
item.setChecked(true);
return false;
}