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:
mike-000
2019-09-24 16:14:36 +01:00
parent f21d698915
commit 678f9136c6
2 changed files with 226 additions and 2 deletions

View File

@@ -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);