Consider background box with stroke for hit detection
This commit is contained in:
@@ -268,7 +268,10 @@ _ol_render_canvas_Replay_.prototype.replayImage_ = function(context, x, y, image
|
||||
createOrUpdate(boxX, boxY, boxX + boxW, boxY + boxH, box);
|
||||
}
|
||||
var canvas = context.canvas;
|
||||
var intersects = box[0] <= canvas.width && box[2] >= 0 && box[1] <= canvas.height && box[3] >= 0;
|
||||
var strokePadding = strokeInstruction ? (strokeInstruction[2] * scale / 2) : 0;
|
||||
var intersects =
|
||||
box[0] - strokePadding <= canvas.width && box[2] + strokePadding >= 0 &&
|
||||
box[1] - strokePadding <= canvas.height && box[3] + strokePadding >= 0;
|
||||
|
||||
if (snapToPixel) {
|
||||
x = Math.round(x);
|
||||
|
||||
Reference in New Issue
Block a user