Make Circle hit detection consistent with Polygon
Fixes one of the inconsistencies seen in #9395 Add hit detection for no fill and transparent fill Based on the example used in #9395 The tests expect consistency between Polygon and Circle geometries but currently expect the inconsistent behaviour seen when using CircleStyle
This commit is contained in:
@@ -31,7 +31,7 @@ class CanvasPolygonBuilder extends CanvasBuilder {
|
||||
drawFlatCoordinatess_(flatCoordinates, offset, ends, stride) {
|
||||
const state = this.state;
|
||||
const fill = state.fillStyle !== undefined;
|
||||
const stroke = state.strokeStyle != undefined;
|
||||
const stroke = state.strokeStyle !== undefined;
|
||||
const numEnds = ends.length;
|
||||
this.instructions.push(beginPathInstruction);
|
||||
this.hitDetectionInstructions.push(beginPathInstruction);
|
||||
@@ -94,9 +94,9 @@ class CanvasPolygonBuilder extends CanvasBuilder {
|
||||
const circleInstruction = [CanvasInstruction.CIRCLE, myBegin];
|
||||
this.instructions.push(beginPathInstruction, circleInstruction);
|
||||
this.hitDetectionInstructions.push(beginPathInstruction, circleInstruction);
|
||||
this.hitDetectionInstructions.push(fillInstruction);
|
||||
if (state.fillStyle !== undefined) {
|
||||
this.instructions.push(fillInstruction);
|
||||
this.hitDetectionInstructions.push(fillInstruction);
|
||||
}
|
||||
if (state.strokeStyle !== undefined) {
|
||||
this.instructions.push(strokeInstruction);
|
||||
|
||||
Reference in New Issue
Block a user