Title: pixelDensity(2) with SVG creates incorrect viewport in the file · Issue #693 · processing/processing4 · GitHub
Open Graph Title: pixelDensity(2) with SVG creates incorrect viewport in the file · Issue #693 · processing/processing4
X Title: pixelDensity(2) with SVG creates incorrect viewport in the file · Issue #693 · processing/processing4
Description: 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 sh...
Open Graph Description: 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 di...
X Description: 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 improv...
Opengraph URL: https://github.com/processing/processing4/issues/693
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"pixelDensity(2) with SVG creates incorrect viewport in the file","articleBody":"In GitLab by @mrbbp on Mar 24, 2023, 09:36\n\n\u003c!--- ** For coding questions, ask the forum: https://discourse.processing.org ** --\u003e\r\n\u003c!--- ** This page is only for bugs in the software \u0026 feature requests ** --\u003e\r\n\r\n\u003c!--- ** If your code won't start, that's a better question for the forum. ** --\u003e\r\n\u003c!--- ** If Processing won't start, post on the forum where you can get help. ** --\u003e\r\n\r\n\u003c!--- ** Also be sure to read the troubleshooting page first: ** --\u003e\r\n\u003c!--- ** https://github.com/processing/processing/wiki/Troubleshooting ** --\u003e\r\n\r\n\u003c!--- ** Before posting, please search Issues for duplicates ** --\u003e \r\n\r\n## Description\r\ni was playing around with svg export and curve drawing.\r\nI'm working on MacOS with a retina display, therefore i add pixelDensity to improve display.\r\n\r\n\u003c!--- Use a title that describes what is happening. --\u003e\r\n\u003c!--- Give a description of the proposed change. --\u003e\r\n\r\n## Expected Behavior\r\n\u003c!--- Bug? Tell us what you were expecting. --\u003e\r\n\u003c!--- Improvement? Tell us how you’d like it to work. --\u003e\r\nthe document should stay in the viewbox\r\n\r\n## Current Behavior\r\n\u003c!--- Explain the difference from current behavior. --\u003e\r\nWhen we export to svg, there is a glitch on the output file.\r\nthere is a `transform=\"scale(2,2)\"` on the exported shape.\r\nI understand why, but in fact it's useless, because it's vector shape exported.\r\nthe document is defined with the right definition (created with `size(width, height)` in the script)\r\nby adding a `transform`, it modify the preview and the size of the shape in the viewbox.\r\n\r\n## Steps to Reproduce\r\n\u003c!--- Provide an unambiguous set of steps to reproduce. --\u003e\r\n\u003c!--- Including code will make it more likely to be fixed. --\u003e\r\n```\r\nimport processing.svg.*;\r\n\r\nvoid setup() {\r\n size(400,400, SVG, \"filename_without_pixeldensity.svg\");\r\n //pixelDensity(2);\r\n}\r\n\r\nvoid draw() {\r\n circle(width/2,height/2, width/2);\r\n exit();\r\n}\r\n```\r\n\r\n## Your Environment\r\n\u003c!--- Include details about your environment. --\u003e\r\n\u003c!--- Thousands of people use Processing every day and may not have this issue, --\u003e \r\n\u003c!--- so this gives us clues about why you’re running into a problem. --\u003e\r\n* Processing version: 4.2\r\n* Operating System and OS version: MacOS Ventura 13.2.1\r\n* Other information: Intel 2018 MBP 13\"\r\n\r\n## Possible Causes / Solutions\r\n\u003c!--- Optionally, if you have a diagnosis or fix in mind, please share. --\u003e\r\nRemove the `transform=\"scale(2,2)\"` on each group of shape\r\nor\r\nadjust the document size (`with`and `height`) according to the `pixelDensity` instruction in the `\u003csvg\u003e` tag to have a correct preview and document viewbox.\r\n\r\n","author":{"url":"https://github.com/processing-bot","@type":"Person","name":"processing-bot"},"datePublished":"2023-03-24T08:36:38.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/693/processing4/issues/693"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d9cccc80-a534-b5f1-4912-92a72e2c3add |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 946A:437AB:1D6CD29:28CB7F8:6A5F3D7B |
| html-safe-nonce | 4adca27ed824b038db2abcdbeae790f0cda99b02a8ec98a3949f1bd4b5de8868 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NDZBOjQzN0FCOjFENkNEMjk6MjhDQjdGODo2QTVGM0Q3QiIsInZpc2l0b3JfaWQiOiI1NzQ0NzQzNTAyOTM4MzI0MzQ3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | c0036bf9bd507ade4d8d4b8461468edbcbbec3934438c1fb65e86aaba690027d |
| hovercard-subject-tag | issue:2472644100 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/processing/processing4/693/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e646558c80b108144ebd47a255b2ca31cc77d0094df9b151cbaa059e076f19fd/processing/processing4/issues/693 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e646558c80b108144ebd47a255b2ca31cc77d0094df9b151cbaa059e076f19fd/processing/processing4/issues/693 |
| og:image:alt | 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 di... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | processing-bot |
| hostname | github.com |
| expected-hostname | github.com |
| None | ab2497d9345a59709926b385d88458fa5932c82ec066288448eb68b34cbcbbda |
| turbo-cache-control | no-preview |
| go-import | github.com/processing/processing4 git https://github.com/processing/processing4.git |
| octolytics-dimension-user_id | 1617169 |
| octolytics-dimension-user_login | processing |
| octolytics-dimension-repository_id | 844382769 |
| octolytics-dimension-repository_nwo | processing/processing4 |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 844382769 |
| octolytics-dimension-repository_network_root_nwo | processing/processing4 |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ba0ac57287507693938b0a2de45402a22cda0785 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width