-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing support for viewBox #20
Comments
Are you working on this? I was just looking for it, happy to help or test. |
It's a bit hard to pin down the exact strategy for implementing this without breaking all sorts of things, but yes, I am working on it (kind of). I'll try to get this done in the next few days. If you've got any thoughts on it, I'm always happy to hear them! :) |
Unfortunately I'm not coming at it with much experience. My intention is to
use it to simulate "cropping", which I think would only require an
interface to read and write the attribute on the SVG tag. I don't have a
sense of the repercussions of this on other components, but I'm happy to
try my use case and see what happens if you want to share a branch.
…On Thu, Dec 29, 2016 at 8:16 AM, Fabian Meyer ***@***.***> wrote:
It's a bit hard to pin down the exact strategy for implementing this
without breaking all sorts of things, but yes, I am working on it (kind
of). I'll try to get this done in the next few days. If you've got any
thoughts on it, I'm always happy to hear them! :)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#20 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARgdmw7dd6oX7k-EGtrvG1THMUk2wYpks5rM9zugaJpZM4LKmJq>
.
|
Setters and getters for arbitrary node attributes are supported since a few versions already. Methods in the form of You should be able to achieve what you need similarly to this: use JangoBrick\SVG\SVGImage;
$image = SVGImage::fromFile('./path/to/file.svg');
$doc = $image->getDocument();
$doc->setAttribute('viewBox', '0 0 200 200');
header('Content-Type: image/svg+xml');
echo $image; |
Thanks, I'll do that! I'll keep an eye on this issue as well to see what
you're up to.
…On Thu, Dec 29, 2016 at 8:49 AM, Fabian Meyer ***@***.***> wrote:
Setters and getters for arbitrary node attributes are supported since a
few versions already. Methods in the form of getHeight() or setX($x) are
only for convenience.
You should be able to achieve what you need similarly to this:
use JangoBrick\SVG\SVGImage;$image = SVGImage::fromFile('./path/to/file.svg');$doc = $image->getDocument();$doc->setAttribute('viewBox', '0 0 200 200');header('Content-Type: image/svg+xml');echo $image;
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#20 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARgdpq-pSqd2_soy182jFMzliBAQKK0ks5rM-SqgaJpZM4LKmJq>
.
|
I've published the viewbox branch, with basic support for the |
I wrote a quick test and got the output viewBox I expected. (There were artifacts from rendering paths, but I'm guessing that's a rasterization challenge - I haven't played much with that yet.) |
No description provided.
The text was updated successfully, but these errors were encountered: