use anchor for offsetting

This commit is contained in:
jkonieczny
2019-12-16 23:24:31 +01:00
committed by Andreas Hocevar
parent 601bd7bae6
commit 1506e13b60
2 changed files with 6 additions and 5 deletions

View File

@@ -371,11 +371,11 @@ class RegularShape extends ImageStyle {
size = this.canvas_.width;
const imageSize = size;
this.draw_(renderOptions, context, this.offset_[0], this.offset_[1]);
this.draw_(renderOptions, context, 0, 0);
this.createHitDetectionCanvas_(renderOptions);
this.anchor_ = [size / 2, size / 2];
this.anchor_ = [size / 2 - this.offset_[0], size / 2 + this.offset_[1]];
this.size_ = [size, size];
this.imageSize_ = [imageSize, imageSize];
}