processing / processing/processing4
pixelDensity(2) with SVG creates incorrect viewport in the file
还没有人认领这个 Issue。
- 主要语言
- Java
- 星标
- 494
- 派生
- 183
- 平均合并
- 4 小时 39 分钟
- 30 天内合并 PR
- 3
描述
In GitLab by @mrbbp on Mar 24, 2023, 09:36
Description
i was playing around with svg export and curve drawing.
I'm working on MacOS with a retina display, therefore i add pixelDensity to improve display.
Expected Behavior
the document should stay in the viewbox
Current Behavior
When we export to svg, there is a glitch on the output file.
there is a transform="scale(2,2)" on the exported shape.
I understand why, but in fact it's useless, because it's vector shape exported.
the document is defined with the right definition (created with size(width, height) in the script)
by adding a transform, it modify the preview and the size of the shape in the viewbox.
Steps to Reproduce
import processing.svg.*;
void setup() {
size(400,400, SVG, "filename_without_pixeldensity.svg");
//pixelDensity(2);
}
void draw() {
circle(width/2,height/2, width/2);
exit();
}
Your Environment
- Processing version: 4.2
- Operating System and OS version: MacOS Ventura 13.2.1
- Other information: Intel 2018 MBP 13"
Possible Causes / Solutions
Remove the transform="scale(2,2)" on each group of shape
or
adjust the document size (withand height) according to the pixelDensity instruction in the <svg> tag to have a correct preview and document viewbox.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
评估
这个 Issue 还没有评估数据。