From c05efa8d7ae464235cf83d7c0956e42dc6974103 Mon Sep 17 00:00:00 2001 From: julieng Date: Sat, 2 Oct 2021 17:20:14 +0200 Subject: move *.html to *.md --- .../canvasrenderingcontext2d/closepath/index.html | 112 --------------------- .../canvasrenderingcontext2d/closepath/index.md | 112 +++++++++++++++++++++ 2 files changed, 112 insertions(+), 112 deletions(-) delete mode 100644 files/fr/web/api/canvasrenderingcontext2d/closepath/index.html create mode 100644 files/fr/web/api/canvasrenderingcontext2d/closepath/index.md (limited to 'files/fr/web/api/canvasrenderingcontext2d/closepath') diff --git a/files/fr/web/api/canvasrenderingcontext2d/closepath/index.html b/files/fr/web/api/canvasrenderingcontext2d/closepath/index.html deleted file mode 100644 index ee83dd8db5..0000000000 --- a/files/fr/web/api/canvasrenderingcontext2d/closepath/index.html +++ /dev/null @@ -1,112 +0,0 @@ ---- -title: CanvasRenderingContext2D.closePath() -slug: Web/API/CanvasRenderingContext2D/closePath -tags: - - Méthode -translation_of: Web/API/CanvasRenderingContext2D/closePath ---- -
{{APIRef}}
- -

La méthode CanvasRenderingContext2D.closePath() de l'API Canvas 2D provoque le retour du stylo au point de départ du sous-traçé courant. Il le fait en ajoutant une ligne droite entre le point courant et le point rejoint. Si la figure a déjà été fermée ou n'est constituée que d'un seul point, cette méthode ne provoque rien.

- -

Syntax

- -
void ctx.closePath();
-
- -

Exemples

- -

Utiliser la méthode closePath

- -

Voici un exemple d'utilisation de la méthode closePath.

- -

HTML

- -
<canvas id="canvas"></canvas>
-
- -

JavaScript

- -
var canvas = document.getElementById("canvas");
-var ctx = canvas.getContext("2d");
-
-ctx.beginPath();
-ctx.moveTo(20,20);
-ctx.lineTo(200,20);
-ctx.lineTo(120,120);
-ctx.closePath(); // ferme le triangle par une ligne droite
-ctx.stroke();
-
- -

Editez le code ci-dessous et observez les répercutions dans le canvas:

- -

Code jouable

- - - - - -

{{ EmbedLiveSample('code_jouable', 700, 400) }}

- -

Spécifications

- - - - - - - - - - - - - - -
SpécificationStatutCommentaire
{{SpecName('HTML WHATWG', "scripting.html#dom-context-2d-closepath", "CanvasRenderingContext2D.closePath")}}{{Spec2('HTML WHATWG')}} 
- -

Compatibilité navigateurs

- -

{{Compat("api.CanvasRenderingContext2D.closePath")}}

- -

Voir également

- - diff --git a/files/fr/web/api/canvasrenderingcontext2d/closepath/index.md b/files/fr/web/api/canvasrenderingcontext2d/closepath/index.md new file mode 100644 index 0000000000..ee83dd8db5 --- /dev/null +++ b/files/fr/web/api/canvasrenderingcontext2d/closepath/index.md @@ -0,0 +1,112 @@ +--- +title: CanvasRenderingContext2D.closePath() +slug: Web/API/CanvasRenderingContext2D/closePath +tags: + - Méthode +translation_of: Web/API/CanvasRenderingContext2D/closePath +--- +
{{APIRef}}
+ +

La méthode CanvasRenderingContext2D.closePath() de l'API Canvas 2D provoque le retour du stylo au point de départ du sous-traçé courant. Il le fait en ajoutant une ligne droite entre le point courant et le point rejoint. Si la figure a déjà été fermée ou n'est constituée que d'un seul point, cette méthode ne provoque rien.

+ +

Syntax

+ +
void ctx.closePath();
+
+ +

Exemples

+ +

Utiliser la méthode closePath

+ +

Voici un exemple d'utilisation de la méthode closePath.

+ +

HTML

+ +
<canvas id="canvas"></canvas>
+
+ +

JavaScript

+ +
var canvas = document.getElementById("canvas");
+var ctx = canvas.getContext("2d");
+
+ctx.beginPath();
+ctx.moveTo(20,20);
+ctx.lineTo(200,20);
+ctx.lineTo(120,120);
+ctx.closePath(); // ferme le triangle par une ligne droite
+ctx.stroke();
+
+ +

Editez le code ci-dessous et observez les répercutions dans le canvas:

+ +

Code jouable

+ + + + + +

{{ EmbedLiveSample('code_jouable', 700, 400) }}

+ +

Spécifications

+ + + + + + + + + + + + + + +
SpécificationStatutCommentaire
{{SpecName('HTML WHATWG', "scripting.html#dom-context-2d-closepath", "CanvasRenderingContext2D.closePath")}}{{Spec2('HTML WHATWG')}} 
+ +

Compatibilité navigateurs

+ +

{{Compat("api.CanvasRenderingContext2D.closePath")}}

+ +

Voir également

+ + -- cgit v1.2.3-54-g00ecf