admin管理员组文章数量:1410682
Why does the canvas not do anything for fillText(text, 0,0)
but works for fillText(text, 10, 10)
?
fillText(text, 0,0):
/
fillText(text, 10, 10):
/
Why does the canvas not do anything for fillText(text, 0,0)
but works for fillText(text, 10, 10)
?
fillText(text, 0,0):
http://jsfiddle.net/kFhQm/4/
fillText(text, 10, 10):
http://jsfiddle.net/kFhQm/5/
- What would you expect it to show? – Dennis Commented Jan 12, 2013 at 1:50
1 Answer
Reset to default 33The second argument is the Y coordinate for the baseline of the text (the default textBaseline
is "alphabetic"
)
, so the text is being drawn above the visible canvas
element when you use 0
.
jsFiddle.
You could use a different number or alternatively, change the textBaseline
property to something suitable, such as "top"
.
ctx.textBaseline = "top";
jsFiddle.
本文标签: javascripthtml5 canvas doesn39t fill text at coordinates (00)Stack Overflow
版权声明:本文标题:javascript - html5 canvas doesn't fill text at coordinates (0,0) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1739060867a2135800.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论