refactor offset to displacement

This commit is contained in:
jkonieczny
2019-12-26 21:41:43 +01:00
committed by Andreas Hocevar
parent 4c7f52c8a4
commit 78378f0253
6 changed files with 40 additions and 28 deletions
+3 -3
View File
@@ -10,7 +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
* @property {Array<number>} [displacement=[0,0]] displacement
*/
@@ -32,7 +32,7 @@ class CircleStyle extends RegularShape {
fill: options.fill,
radius: options.radius,
stroke: options.stroke,
offset: options.offset !== undefined ? options.offset : [0, 0]
displacement: options.displacement !== undefined ? options.displacement : [0, 0]
});
}
@@ -48,7 +48,7 @@ class CircleStyle extends RegularShape {
fill: this.getFill() ? this.getFill().clone() : undefined,
stroke: this.getStroke() ? this.getStroke().clone() : undefined,
radius: this.getRadius(),
offset: this.getOffset().slice()
displacement: this.getDisplacement().slice()
});
style.setOpacity(this.getOpacity());
style.setScale(this.getScale());