[DE] Bug 40719: textart settings.

This commit is contained in:
Julia Radzhabova 2019-06-06 17:20:05 +03:00
parent 5fe0c2027c
commit e02ef3e65f

View file

@ -153,6 +153,8 @@ define([
fill.get_fill().put_linear_scale(true);
}
if (this.OriginalFillType !== Asc.c_oAscFill.FILL_TYPE_GRAD) {
this.GradColor.values = [0, 100];
this.GradColor.colors = [this.GradColor.colors[0], this.GradColor.colors[this.GradColor.colors.length - 1]];
var HexColor0 = Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[0]).get_color().get_hex(),
HexColor1 = Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[1]).get_color().get_hex();
@ -352,14 +354,22 @@ define([
fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD);
fill.put_fill( new Asc.asc_CFillGrad());
fill.get_fill().put_grad_type(this.GradFillType);
fill.get_fill().put_colors([Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[0]), Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[1])]);
var arr = [];
this.GradColor.colors.forEach(function(item){
arr.push(Common.Utils.ThemeColor.getRgbColor(item));
});
fill.get_fill().put_colors(arr);
if (this.OriginalFillType !== Asc.c_oAscFill.FILL_TYPE_GRAD) {
if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) {
fill.get_fill().put_linear_angle(this.GradLinearDirectionType * 60000);
fill.get_fill().put_linear_scale(true);
}
fill.get_fill().put_positions([this.GradColor.values[0]*1000, this.GradColor.values[1]*1000]);
arr = [];
this.GradColor.values.forEach(function(item){
arr.push(item*1000);
});
fill.get_fill().put_positions(arr);
}
props.asc_putFill(fill);
this.shapeprops.put_TextArtProperties(props);
@ -397,14 +407,22 @@ define([
fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD);
fill.put_fill( new Asc.asc_CFillGrad());
fill.get_fill().put_grad_type(this.GradFillType);
fill.get_fill().put_positions([this.GradColor.values[0]*1000, this.GradColor.values[1]*1000]);
var arr = [];
this.GradColor.values.forEach(function(item){
arr.push(item*1000);
});
fill.get_fill().put_positions(arr);
if (this.OriginalFillType !== Asc.c_oAscFill.FILL_TYPE_GRAD) {
if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) {
fill.get_fill().put_linear_angle(this.GradLinearDirectionType * 60000);
fill.get_fill().put_linear_scale(true);
}
fill.get_fill().put_colors([Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[0]), Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[1])]);
arr = [];
this.GradColor.colors.forEach(function(item){
arr.push(Common.Utils.ThemeColor.getRgbColor(item));
});
fill.get_fill().put_colors(arr);
}
props.asc_putFill(fill);
this.shapeprops.put_TextArtProperties(props);
@ -565,7 +583,7 @@ define([
this.ShapeColor = {Value: 0, Color: 'transparent'};
this.OriginalFillType = Asc.c_oAscFill.FILL_TYPE_SOLID;
this.GradColor.colors[0] = (this.ShapeColor.Color!=='transparent') ? Common.Utils.ThemeColor.colorValue2EffectId(this.ShapeColor.Color) : '000000';
this.GradColor.colors[1] = 'ffffff';
this.GradColor.colors[this.GradColor.colors.length-1] = 'ffffff';
} else if (fill_type==Asc.c_oAscFill.FILL_TYPE_GRAD) {
fill = fill.get_fill();
var gradfilltype = fill.get_grad_type(); // null - не совпадают у нескольких фигур
@ -596,49 +614,37 @@ define([
}
}
var colors = fill.get_colors();
if (colors && colors.length>0) {
color = colors[0];
var me = this;
var colors = fill.get_colors(),
positions = fill.get_positions(),
length = colors.length;
this.sldrGradient.setThumbs(length);
if (this.GradColor.colors.length>length) {
this.GradColor.colors.splice(length, this.GradColor.colors.length - length);
this.GradColor.values.splice(length, this.GradColor.colors.length - length);
this.GradColor.currentIdx = 0;
}
colors && colors.forEach(function(color, index) {
if (color) {
if (color.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) {
this.GradColor.colors[0] = {color: Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b()), effectValue: color.get_value()};
Common.Utils.ThemeColor.colorValue2EffectId(this.GradColor.colors[0]);
me.GradColor.colors[index] = {color: Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b()), effectValue: color.get_value()};
Common.Utils.ThemeColor.colorValue2EffectId(me.GradColor.colors[index]);
} else {
this.GradColor.colors[0] = Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b());
me.GradColor.colors[index] = Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b());
}
} else
this.GradColor.colors[0] = '000000';
me.GradColor.colors[index] = '000000';
color = colors[1];
if (color) {
if (color.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) {
this.GradColor.colors[1] = {color: Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b()), effectValue: color.get_value()};
Common.Utils.ThemeColor.colorValue2EffectId(this.GradColor.colors[1]);
} else {
this.GradColor.colors[1] = Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b());
}
} else
this.GradColor.colors[1] = 'ffffff';
}
var positions = fill.get_positions();
if (positions && positions.length>0) {
var position = positions[0];
var position = positions[index];
if (position!==null) {
position = position/1000;
this.GradColor.values[0] = position;
}
position = positions[1];
if (position!==null) {
position = position/1000;
this.GradColor.values[1] = position;
me.GradColor.values[index] = position;
}
});
for (var index=0; index<length; index++) {
me.sldrGradient.setColorValue(Common.Utils.String.format('#{0}', (typeof(me.GradColor.colors[index]) == 'object') ? me.GradColor.colors[index].color : me.GradColor.colors[index]), index);
me.sldrGradient.setValue(index, me.GradColor.values[index]);
}
this.sldrGradient.setColorValue(Common.Utils.String.format('#{0}', (typeof(this.GradColor.colors[0]) == 'object') ? this.GradColor.colors[0].color : this.GradColor.colors[0]), 0);
this.sldrGradient.setColorValue(Common.Utils.String.format('#{0}', (typeof(this.GradColor.colors[1]) == 'object') ? this.GradColor.colors[1].color : this.GradColor.colors[1]), 1);
this.sldrGradient.setValue(0, this.GradColor.values[0]);
this.sldrGradient.setValue(1, this.GradColor.values[1]);
this.OriginalFillType = Asc.c_oAscFill.FILL_TYPE_GRAD;
this.ShapeColor = {Value: 1, Color: this.GradColor.colors[0]};
}