oksvg icon indicating copy to clipboard operation
oksvg copied to clipboard

Announce: SVG Editor

Open stuartmscott opened this issue 4 years ago • 2 comments

Hey @srwiley,

This is not an issue so feel free to close, but I just wanted to tell you about a simple SVG Editor I was able to create thanks to oksvg and rasterx.

Keep up the great work!

stuartmscott avatar Nov 12 '20 02:11 stuartmscott

That looks great Stuart. Also I like you previous suggestion also. I just have been focused on different things for a while. If you would like to submit a pull request to make the line width proportional to the image scale, as per the specifications, I will take a good look. Otherwise I assure you I will get to it eventually.

Also, if you have the time please take a look at the imageElt branch in oksvg submitted by another github user. I want to clean it up somewhat, like take out the logging in the inner loops, but overall what do you think about things like the modules statement?

srwiley avatar Nov 13 '20 03:11 srwiley

Thanks Steven!

I think the change would be two parts, one in the data structure to parse and hold the value (either fixed, or percentage), and another in the rasterizer to either pass through the fixed value or calculate the percentage based on the requested output size.

The imageElt branch looks okay, moving to the Shape interface should give more flexibility to support future features.

I found the comments lacking and don't provide any more information than the line of code they annotate: // Shape type., // Image type., // KernelUsed var., and // DrawTransformed func.

I made the switch to Go modules a while back and for the most part I'm glad I did, however there is one scenario where they could be better - they slow down local experimentation across projects. Consider the case where you want to try out a change across rasterx and oksvg, if your current setup has them both in the GOPATH then you can make the changes and the compiler would find them. However with go modules, every dependency is versioned so you have two options either make a change in rasterx, commit and push, then switch to oksvg and run go get to pull down the latest version of rasterx. If you're experimenting you may not want to push a half-baked change. You're other option is to use an replace statement in oksvg to say replace github.com/srwiley/rasterx => ../rasterx to tell go to use the local copy, but you do not want to add this replace directive to the repository as it could break other developers setups, so you need to remember not to add it to any resulting commits. Ideally there would be a go.mod.local or some other name that you can add to .gitignore where you can put these replace directives for local development unfortunately there has not been much progress: https://github.com/golang/go/issues/26640

stuartmscott avatar Nov 18 '20 14:11 stuartmscott