Offset for ImageStyle

This commit is contained in:
jkonieczny
2019-12-18 08:22:40 +01:00
committed by Andreas Hocevar
parent ee1b038714
commit 4c7f52c8a4
4 changed files with 28 additions and 27 deletions
+5 -2
View File
@@ -10,6 +10,7 @@ import RegularShape from './RegularShape.js';
* @property {import("./Fill.js").default} [fill] Fill style.
* @property {number} radius Circle radius.
* @property {import("./Stroke.js").default} [stroke] Stroke style.
* @property {Array<number>} [offset=[0,0]] offset
*/
@@ -30,7 +31,8 @@ class CircleStyle extends RegularShape {
points: Infinity,
fill: options.fill,
radius: options.radius,
stroke: options.stroke
stroke: options.stroke,
offset: options.offset !== undefined ? options.offset : [0, 0]
});
}
@@ -45,7 +47,8 @@ class CircleStyle extends RegularShape {
const style = new CircleStyle({
fill: this.getFill() ? this.getFill().clone() : undefined,
stroke: this.getStroke() ? this.getStroke().clone() : undefined,
radius: this.getRadius()
radius: this.getRadius(),
offset: this.getOffset().slice()
});
style.setOpacity(this.getOpacity());
style.setScale(this.getScale());