Clone backgroundFill and backgroundStroke
This commit is contained in:
@@ -151,7 +151,9 @@ _ol_style_Text_.prototype.clone = function() {
|
|||||||
fill: this.getFill() ? this.getFill().clone() : undefined,
|
fill: this.getFill() ? this.getFill().clone() : undefined,
|
||||||
stroke: this.getStroke() ? this.getStroke().clone() : undefined,
|
stroke: this.getStroke() ? this.getStroke().clone() : undefined,
|
||||||
offsetX: this.getOffsetX(),
|
offsetX: this.getOffsetX(),
|
||||||
offsetY: this.getOffsetY()
|
offsetY: this.getOffsetY(),
|
||||||
|
backgroundFill: this.getBackgroundFill() ? this.getBackgroundFill().clone() : undefined,
|
||||||
|
backgroundStroke: this.getBackgroundStroke() ? this.getBackgroundStroke().clone() : undefined
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -52,6 +52,12 @@ describe('ol.style.Text', function() {
|
|||||||
}),
|
}),
|
||||||
stroke: new _ol_style_Stroke_({
|
stroke: new _ol_style_Stroke_({
|
||||||
color: '#319FD3'
|
color: '#319FD3'
|
||||||
|
}),
|
||||||
|
backgroundFill: new _ol_style_Fill_({
|
||||||
|
color: 'white'
|
||||||
|
}),
|
||||||
|
backgroundStroke: new _ol_style_Stroke_({
|
||||||
|
color: 'black'
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
var clone = original.clone();
|
var clone = original.clone();
|
||||||
@@ -66,6 +72,8 @@ describe('ol.style.Text', function() {
|
|||||||
expect(original.getTextBaseline()).to.eql(clone.getTextBaseline());
|
expect(original.getTextBaseline()).to.eql(clone.getTextBaseline());
|
||||||
expect(original.getStroke().getColor()).to.eql(clone.getStroke().getColor());
|
expect(original.getStroke().getColor()).to.eql(clone.getStroke().getColor());
|
||||||
expect(original.getFill().getColor()).to.eql(clone.getFill().getColor());
|
expect(original.getFill().getColor()).to.eql(clone.getFill().getColor());
|
||||||
|
expect(original.getBackgroundStroke().getColor()).to.eql(clone.getBackgroundStroke().getColor());
|
||||||
|
expect(original.getBackgroundFill().getColor()).to.eql(clone.getBackgroundFill().getColor());
|
||||||
});
|
});
|
||||||
|
|
||||||
it('the clone does not reference the same objects as the original', function() {
|
it('the clone does not reference the same objects as the original', function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user