Merge pull request #49 from cwjokaka/branch-patch

修正第15章变量名称
This commit is contained in:
piglei 2020-06-30 07:42:20 +08:00 committed by GitHub
commit 88f6ad859e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -429,8 +429,8 @@ while True:
```python
while True:
# 使用 % page_with 控制不要超过页面宽度
element.position_x = (element.position_x + width_unit) % page_with
# 使用 % page_width 控制不要超过页面宽度
element.position_x = (element.position_x + width_unit) % page_width
```
这样写的话,代码里的边界情况就连着那行 `if` 语句一起消失了。