processing / processing/processing4
loadShape() problems with SVGs that have . starting a number in a path
未关闭
还没有人认领这个 Issue。
has attachment
help wanted
- 主要语言
- Java
- 星标
- 494
- 派生
- 183
- 平均合并
- 4 小时 39 分钟
- 30 天内合并 PR
- 3
描述
Created by: benfry
Re-saving the SVG in 1.0 format with Illustrator instead of 1.1 will fix the issue, but the problem seems to be that a leading . in the SVG path code won't render properly, for instance:
M3,.6– parse toM,3,.6(may be fixed with https://github.com/processing/processing4/commit/9ef40ba48c284ae52e7eae759af325486ca85f1e)M.6.7– parse toM,.6, and.7- …etc
This caused a problem with the variable icons, which was fixed commit 805306fd1b4eeeac35bf1c29693d751edf349f57, so using the previous version of the SVGs should do the trick for testing.
Test code:
static final String[] names = {
"array", "boolean", "byte", "char", "double", "float",
"integer", "long", "object", "short", "string"
};
void setup() {
size(250, 550);
textAlign(LEFT, CENTER);
textSize(24);
fill(0);
int each = 50;
int pos = 0;
for (String name : names) {
PShape s = loadShape(name + ".svg");
shape(s, 0, pos, each, each);
text(name, 60, pos + each/2);
pos += each;
}
saveFrame("issue.png");
}

贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 loadShape() 和 SVG 路径解析入口开始,然后使用 issue 中提到的之前的 SVG 版本复现所提供的草图。检查 M3,.6 和 M.6.7 等路径的分词;当带前导小数点的坐标能够正确解析,并且可变图标按预期渲染时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java
- 领域
- computer-graphics
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 38/100