Clone the text's padding
This commit is contained in:
@@ -184,7 +184,8 @@ class Text {
|
||||
offsetX: this.getOffsetX(),
|
||||
offsetY: this.getOffsetY(),
|
||||
backgroundFill: this.getBackgroundFill() ? this.getBackgroundFill().clone() : undefined,
|
||||
backgroundStroke: this.getBackgroundStroke() ? this.getBackgroundStroke().clone() : undefined
|
||||
backgroundStroke: this.getBackgroundStroke() ? this.getBackgroundStroke().clone() : undefined,
|
||||
padding: this.getPadding()
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,8 @@ describe('ol.style.Text', function() {
|
||||
}),
|
||||
backgroundStroke: new Stroke({
|
||||
color: 'black'
|
||||
})
|
||||
}),
|
||||
padding: [10, 11, 12, 13]
|
||||
});
|
||||
const clone = original.clone();
|
||||
expect(original.getFont()).to.eql(clone.getFont());
|
||||
@@ -74,6 +75,7 @@ describe('ol.style.Text', function() {
|
||||
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());
|
||||
expect(original.getPadding()).to.eql(clone.getPadding());
|
||||
});
|
||||
|
||||
it('the clone does not reference the same objects as the original', function() {
|
||||
|
||||
Reference in New Issue
Block a user