Merge pull request #12507 from MoonE/fix-regular-shape-hit-detect-transparent-fill

Fix regular shape hit detect transparent fill
This commit is contained in:
MoonE
2021-07-13 17:54:41 +02:00
committed by GitHub

View File

@@ -9,7 +9,6 @@ import {asColorLike} from '../colorlike.js';
import {createCanvasContext2D} from '../dom.js'; import {createCanvasContext2D} from '../dom.js';
import { import {
defaultFillStyle, defaultFillStyle,
defaultLineCap,
defaultLineJoin, defaultLineJoin,
defaultLineWidth, defaultLineWidth,
defaultMiterLimit, defaultMiterLimit,
@@ -39,7 +38,6 @@ import {
* @property {import("../colorlike.js").ColorLike} [strokeStyle] StrokeStyle. * @property {import("../colorlike.js").ColorLike} [strokeStyle] StrokeStyle.
* @property {number} strokeWidth StrokeWidth. * @property {number} strokeWidth StrokeWidth.
* @property {number} size Size. * @property {number} size Size.
* @property {CanvasLineCap} lineCap LineCap.
* @property {Array<number>} lineDash LineDash. * @property {Array<number>} lineDash LineDash.
* @property {number} lineDashOffset LineDashOffset. * @property {number} lineDashOffset LineDashOffset.
* @property {CanvasLineJoin} lineJoin LineJoin. * @property {CanvasLineJoin} lineJoin LineJoin.
@@ -419,7 +417,6 @@ class RegularShape extends ImageStyle {
* @protected * @protected
*/ */
createRenderOptions() { createRenderOptions() {
let lineCap = defaultLineCap;
let lineJoin = defaultLineJoin; let lineJoin = defaultLineJoin;
let miterLimit = 0; let miterLimit = 0;
let lineDash = null; let lineDash = null;
@@ -443,10 +440,6 @@ class RegularShape extends ImageStyle {
if (lineJoin === undefined) { if (lineJoin === undefined) {
lineJoin = defaultLineJoin; lineJoin = defaultLineJoin;
} }
lineCap = this.stroke_.getLineCap();
if (lineCap === undefined) {
lineCap = defaultLineCap;
}
miterLimit = this.stroke_.getMiterLimit(); miterLimit = this.stroke_.getMiterLimit();
if (miterLimit === undefined) { if (miterLimit === undefined) {
miterLimit = defaultMiterLimit; miterLimit = defaultMiterLimit;
@@ -461,7 +454,6 @@ class RegularShape extends ImageStyle {
strokeStyle: strokeStyle, strokeStyle: strokeStyle,
strokeWidth: strokeWidth, strokeWidth: strokeWidth,
size: size, size: size,
lineCap: lineCap,
lineDash: lineDash, lineDash: lineDash,
lineDashOffset: lineDashOffset, lineDashOffset: lineDashOffset,
lineJoin: lineJoin, lineJoin: lineJoin,
@@ -509,7 +501,6 @@ class RegularShape extends ImageStyle {
context.setLineDash(renderOptions.lineDash); context.setLineDash(renderOptions.lineDash);
context.lineDashOffset = renderOptions.lineDashOffset; context.lineDashOffset = renderOptions.lineDashOffset;
} }
context.lineCap = renderOptions.lineCap;
context.lineJoin = renderOptions.lineJoin; context.lineJoin = renderOptions.lineJoin;
context.miterLimit = renderOptions.miterLimit; context.miterLimit = renderOptions.miterLimit;
context.stroke(); context.stroke();
@@ -596,6 +587,8 @@ class RegularShape extends ImageStyle {
context.setLineDash(renderOptions.lineDash); context.setLineDash(renderOptions.lineDash);
context.lineDashOffset = renderOptions.lineDashOffset; context.lineDashOffset = renderOptions.lineDashOffset;
} }
context.lineJoin = renderOptions.lineJoin;
context.miterLimit = renderOptions.miterLimit;
context.stroke(); context.stroke();
} }
} }