I am trying to write custom functions for the editor, for this I would
need to get the dimensions of objects on the canvas.
I tried out a quick test:
// in editor.js line 297
if(shape){
shape.id = this.generateUUID();
shape.attr({
"fill": this.prop.fill,
"stroke": this.prop.stroke,
"stroke-width": this.prop["stroke-width"],
"fill-opacity": this.prop['fill-opacity'],
"stroke-opacity": this.prop["stroke-opacity"]
})
this.addShape(shape);
alert(shape.getBBox().width); ---> Does not alert proper values
Strangely, the values are always 0 or -1. Does anyone have an idea
what I am doing wrong?
Thanks
| Voltron it might be a bug and also is this the same result on all primitives including path? GETBBOX is not 100% Take a look at this code (I include it in case it might spark some thought) http://www.irunmywebsite.com/raphael/additionalhelp.html?q=plugingetbboxrotated Charles --- On Tue, 3/2/10, voltron <nhy...@googlemail.com> wrote: |
var bBox = c.getBBox();
On Mar 2, 12:43 pm, charles thomas <charles...@yahoo.com> wrote:
> Voltron
>
> it might be a bug and also is this the same result on all primitives including path?
>
> GETBBOX is not 100%
>
> Take a look at this code (I include it in case it might spark some thought)
>
> http://www.irunmywebsite.com/raphael/additionalhelp.html?q=plugingetb...
> __________________________________________________________________
> The new Internet Explorer® 8 - Faster, safer, easier. Optimized for Yahoo! Get it Now for Free! athttp://downloads.yahoo.com/ca/internetexplorer/