未验证 提交 24e8c633 编写于 作者: O openharmony_ci 提交者: Gitee

!15494 翻译完成 14803:docs同步OHOS 3

Merge pull request !15494 from ester.zhou/TR-14803
...@@ -585,7 +585,7 @@ Fills a rectangle on the canvas. ...@@ -585,7 +585,7 @@ Fills a rectangle on the canvas.
```html ```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div> <div>
<canvas ref="canvas" style="width: 500px; height: 500px; "></canvas> <canvas ref="canvas" style="width: 500px; height: 500px; background-color: #ffff00;"></canvas>
</div> </div>
``` ```
...@@ -621,7 +621,7 @@ Clears the content in a rectangle on the canvas. ...@@ -621,7 +621,7 @@ Clears the content in a rectangle on the canvas.
```html ```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div> <div>
<canvas ref="canvas" style="width: 500px; height: 500px;"></canvas> <canvas ref="canvas" style="width: 500px; height: 500px; background-color: #ffff00;"></canvas>
</div> </div>
``` ```
......
...@@ -95,12 +95,36 @@ Checks whether a specified point is in the path area. ...@@ -95,12 +95,36 @@ Checks whether a specified point is in the path area.
**Example** **Example**
```html ```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div style="width: 500px; height: 500px;"> <div class="container" style="width: 500px; height: 500px;">
<text>In path:{{textValue}}</text> <text class="textsize">In path:{{textValue}}</text>
<canvas ref="canvas" style="width: 500px; height: 500px; background-color: #ffff00;"></canvas> <canvas ref="canvas" style="width: 500px; height: 500px; background-color: #ffff00;"></canvas>
</div> </div>
``` ```
```css
/* xxx.css */
.container {
display: flex;
flex-direction: column;
background-color: #F1F3F5;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
}
canvas {
width: 600px;
height: 600px;
background-color: #fdfdfd;
border: none;
}
.textsize {
font-size: 40px;
}
```
```js ```js
// xxx.js // xxx.js
export default { export default {
...@@ -145,12 +169,36 @@ Checks whether a specified point is on the edge line of a path. ...@@ -145,12 +169,36 @@ Checks whether a specified point is on the edge line of a path.
**Example** **Example**
```html ```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div style="width: 500px; height: 500px;"> <div class="container" style="width: 500px; height: 500px;">
<text>In path:{{textValue}}</text> <text class="textsize">In stroke:{{textValue}}</text>
<canvas ref="canvas" style="width: 500px; height: 500px; background-color: #ffff00;"></canvas> <canvas ref="canvas" style="width: 500px; height: 500px; background-color: #ffff00;"></canvas>
</div> </div>
``` ```
```css
/* xxx.css */
.container {
display: flex;
flex-direction: column;
background-color: #F1F3F5;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
}
canvas {
width: 600px;
height: 600px;
background-color: #fdfdfd;
border: none;
}
.textsize {
font-size: 40px;
}
```
```js ```js
// xxx.js // xxx.js
export default { export default {
...@@ -181,12 +229,36 @@ resetTransform(): void ...@@ -181,12 +229,36 @@ resetTransform(): void
**Example** **Example**
```html ```html
<!-- xxx.hml --> <!-- xxx.hml -->
<div style="width: 500px; height: 500px;"> <div class="container" style="width: 500px; height: 500px;">
<text>In path:{{textValue}}</text> <text class="textsize">In path:{{textValue}}</text>
<canvas ref="canvas" style="width: 500px; height: 500px; background-color: #ffff00;"></canvas> <canvas ref="canvas" style="width: 500px; height: 500px; background-color: #ffff00;"></canvas>
</div> </div>
``` ```
```css
/* xxx.css */
.container {
display: flex;
flex-direction: column;
background-color: #F1F3F5;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
}
canvas {
width: 600px;
height: 600px;
background-color: #fdfdfd;
border: none;
}
.textsize {
font-size: 40px;
}
```
```js ```js
// xxx.js // xxx.js
export default { export default {
......
...@@ -60,7 +60,7 @@ export default { ...@@ -60,7 +60,7 @@ export default {
path.closePath(); path.closePath();
// Door // Door
path.moveTo(250, 450); path.moveTo(250, 450);
path.rect(250, 450, 350, 600); path.rect(250, 450, 100, 600);
path.closePath(); path.closePath();
// Chimney // Chimney
path.moveTo(365, 250); path.moveTo(365, 250);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册