No unnecessary canvas with transparent fill
With pixelRatio != 1 and a transparent fill a unnecessary image was created.
This commit is contained in:
@@ -494,7 +494,6 @@ class RegularShape extends ImageStyle {
|
|||||||
* @param {RenderOptions} renderOptions Render options.
|
* @param {RenderOptions} renderOptions Render options.
|
||||||
*/
|
*/
|
||||||
createHitDetectionCanvas_(renderOptions) {
|
createHitDetectionCanvas_(renderOptions) {
|
||||||
this.hitDetectionCanvas_ = this.getImage(1);
|
|
||||||
if (this.fill_) {
|
if (this.fill_) {
|
||||||
let color = this.fill_.getColor();
|
let color = this.fill_.getColor();
|
||||||
|
|
||||||
@@ -520,6 +519,9 @@ class RegularShape extends ImageStyle {
|
|||||||
this.drawHitDetectionCanvas_(renderOptions, context, 0, 0);
|
this.drawHitDetectionCanvas_(renderOptions, context, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!this.hitDetectionCanvas_) {
|
||||||
|
this.hitDetectionCanvas_ = this.getImage(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user