-
Notifications
You must be signed in to change notification settings - Fork 18
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
Avoid automatic centering? #1
Comments
Do you mean like this? |
Well yeah, but then the move() function stops working. I guess the x and y position could be set in the settings object, but that wouldn't follow the style of the rest of the library. Do you think it would be possible to override the centering at all, without messing with the core svg.js? |
Well, the logic is correct because the http://jsfiddle.net/wout/Y73un/4/ Or you could put the path in a group: http://jsfiddle.net/wout/Y73un/5/ Or you could create the Many options :) |
Just thinking, why don't you create a separate class here? SVG.Wedge = function() {
this.constructor.call(this, SVG.create('path'))
}
// Inherit from SVG.Path
SVG.Wedge.prototype = new SVG.Path
SVG.extend(SVG.Wedge, {
move: function(x, y) {
return this.translate(x, y)
}
})
SVG.extend(SVG.Container, {
wedge: function(options) {
return this.put(new SVG.Wedge).plot(SVG.shapes.wedge(options))
}
}) This way you don't break the api while giving yourself a very flexible environment. Usage would be: var wedge = draw.wedge({ ... options ... }) |
Ah yes, that's a great idea! I guess i thought it would be nice to have all the shapes in one place, but the wedge might be a bit too different. Thanks for the help! |
I am thinking of completely rebuilding the |
I implemented a new function in svg.js to make it easier to create your own shapes: |
Is it possible to avoid the automatic centering when creating a new shape? I'm creating a wedge shape and want the center of the shape to be based on the radius value rather than the actual shape. You can see the issue i'm having here: http://jsfiddle.net/Y73un/1/
The text was updated successfully, but these errors were encountered: