Tela HTML método isPointInPath()
Exemplo
Desenhe um retângulo se o ponto 20, 50 estiver no caminho atual:
JavaScript:
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
ctx.rect(20, 20, 150, 100);
if (ctx.isPointInPath(20, 50)) {
ctx.stroke();
};
Suporte ao navegador
Os números na tabela especificam a primeira versão do navegador que oferece suporte total ao método.
Method | |||||
---|---|---|---|---|---|
isPointInPath() | 4.0 | 9.0 | 3.6 | 4.0 | 10.1 |
Definição e uso
O método isPointInPath() retorna true se o ponto especificado estiver no caminho atual, caso contrário, false.
Sintaxe JavaScript: | context .isPointInPath( x, y ); |
---|
Valores de parâmetro
Parameter | Description |
---|---|
x | The x-coordinate to test |
y | The y-coordinate to test |
❮ Objeto de tela