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
+7 -7
View File
@@ -10,7 +10,7 @@ import {abstract} from '../util.js';
* @property {boolean} rotateWithView
* @property {number} rotation
* @property {number} scale
* @property {Array<number>} offset
* @property {Array<number>} displacement
*/
@@ -56,7 +56,7 @@ class ImageStyle {
* @private
* @type {Array<number>}
*/
this.offset_ = options.offset;
this.displacement_ = options.displacement;
}
@@ -71,7 +71,7 @@ class ImageStyle {
scale: this.getScale(),
rotation: this.getRotation(),
rotateWithView: this.getRotateWithView(),
offset: this.getOffset().slice()
displacement: this.getDisplacement().slice()
});
}
@@ -112,12 +112,12 @@ class ImageStyle {
}
/**
* Get the offset of the shape
* @return {Array<number>} Shape's center offset
* Get the displacement of the shape
* @return {Array<number>} Shape's center displacement
* @api
*/
getOffset() {
return this.offset_;
getDisplacement() {
return this.displacement_;
}
/**