Skip to content

Commit da02cc7

Browse files
committed
Update
1 parent 9594994 commit da02cc7

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎CustomView/Fix/DrawText.md‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,16 @@
88

99
## 错误原因
1010

11-
这个错误是drawText方法中坐标的一个问题,就一般的绘图而言,坐标一般都是指定左上角,然而drawText默认并不是左上角,甚至不是大家测试后认为的左下角,而是一个由paint中Align决定的对齐基准线,该API原文如下:
11+
这个错误是drawText方法中坐标的一个问题,就一般的绘图而言,坐标一般都是指定左上角,然而drawText默认并不是左上角,甚至不是大家测试后认为的左下角,而是一个**由Paint中Align决定的对齐基准线**,该API原文如下:
1212

1313
> Draw the text, with origin at (x,y), using the specified paint. **The origin is interpreted based on the Align setting in the paint.**
1414
15+
在默认情况下基线如下图所示:
16+
17+
## 分析原因
18+
19+
** Q: 为何要采用基线对齐方式?**
20+
21+
> A :
1522
1623

0 commit comments

Comments
 (0)