svg - SVG文本翻转/镜像
问题描述
SVG 菜鸟在这里。我只想水平或垂直翻转 SVG 文本元素,但添加transform="scale(-1, 1)"
属性会导致空白结果。
<html>
<body>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="200"
height="200">
<text x="100"
y="100"
transform="scale(-1, 1)">SVG test text</text>
</svg>
</body>
</html>
解决方案
它不在 SVG 画布上。100 的 x 变为 -100,因为它也被缩放了。我刚刚否定了 x 值以使其再次可见。
<html>
<body>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="200"
height="200">
<text x="-100"
y="100"
transform="scale(-1, 1)">SVG test text</text>
</svg>
</body>
</html>
推荐阅读
- sql - IBM Cloud Functions:尝试连接到 DB2 时出现 SQL 语法错误
- reactjs - 在 setState 之后反应钩子 setTimeout
- python - Pycharm 调试器在使用 dask 分布式时抛出 Bad file descriptor 错误
- python - 当我在 tkinter 中多次按下开始和暂停按钮时,倒数计时器的速度会增加
- reactjs - React 测试库 - 检查是否存在空 div
- f# - 类型提供者'ProviderImplementation.HtmlProvider'报错:cookie的'Value'='XXXX'部分无效
- python - 如何使用 for 循环将第一次使用日期存储在字典中
- c++ - 谷歌模拟框架匹配器元素数组比较
- python - 如何使用 CFFI 调用结构
- asp.net - 即使已登录,如何修复“未经授权的错误 401”?