diff options
author | Sasha Sushko <sushko@outlook.com> | 2021-10-20 00:18:15 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-20 00:18:15 +0300 |
commit | bc845fe1546d53b6a8392d4f85755f56ed59b975 (patch) | |
tree | e3b4816f89016545e687236ef5ff890603cefc77 /files/ru | |
parent | 4d9e624863b211070f0df5572389d64cec46abce (diff) | |
download | translated-content-bc845fe1546d53b6a8392d4f85755f56ed59b975.tar.gz translated-content-bc845fe1546d53b6a8392d4f85755f56ed59b975.tar.bz2 translated-content-bc845fe1546d53b6a8392d4f85755f56ed59b975.zip |
(ru) Fix example at Drawing Shapes page (#2783)
In the footsteps of https://github.com/mdn/content/pull/9893
Diffstat (limited to 'files/ru')
-rw-r--r-- | files/ru/web/api/canvas_api/tutorial/drawing_shapes/index.html | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/files/ru/web/api/canvas_api/tutorial/drawing_shapes/index.html b/files/ru/web/api/canvas_api/tutorial/drawing_shapes/index.html index 666d80acbf..5f6d218718 100644 --- a/files/ru/web/api/canvas_api/tutorial/drawing_shapes/index.html +++ b/files/ru/web/api/canvas_api/tutorial/drawing_shapes/index.html @@ -492,17 +492,13 @@ original_slug: Web/API/Canvas_API/Tutorial/Рисование_фигур // A utility function to draw a rectangle with rounded corners. -function roundedRect(ctx,x,y,width,height,radius){ +function roundedRect(ctx, x, y, width, height, radius) { ctx.beginPath(); - ctx.moveTo(x,y+radius); - ctx.lineTo(x,y+height-radius); - ctx.quadraticCurveTo(x,y+height,x+radius,y+height); - ctx.lineTo(x+width-radius,y+height); - ctx.quadraticCurveTo(x+width,y+height,x+width,y+height-radius); - ctx.lineTo(x+width,y+radius); - ctx.quadraticCurveTo(x+width,y,x+width-radius,y); - ctx.lineTo(x+radius,y); - ctx.quadraticCurveTo(x,y,x,y+radius); + ctx.moveTo(x, y + radius); + ctx.arcTo(x, y + height, x + radius, y + height, radius); + ctx.arcTo(x + width, y + height, x + width, y + height - radius, radius); + ctx.arcTo(x + width, y, x + width - radius, y, radius); + ctx.arcTo(x, y, x, y + radius, radius); ctx.stroke(); } </pre> |