Closed deepblue-phoenix closed 11 years ago
great library by the way. just want to encourage you to continue! :)
even after I manually assign values to the width/height of the Shape instance, when reading those properties back they still return 0
so on line 112 and 113 in DisplayObject.dart I see this: num get width => getBoundsTransformed(_transformationMatrix).width; num get height => getBoundsTransformed(_transformationMatrix).height;
and in the same file in function getBoundsTransformed() on line 255 and 256 I see this: returnRectangle.width = 0; returnRectangle.height = 0; return returnRectangle;
so, it seems that width/height of returnRectangle are always set to 0, which is whats always returned by the getters...
I just glanced at the code though, so I might be missing something.
Hello
Yes you are absolutely right. Currently the Shape does not calculate it's size and therefore you also can't use it as a mouse target - that's very unfortunate. Please give me a few days to take a look at that and i will try to implement the correct behavior.
Thank you for reporting this issue and also for the kind words about the library.
Bernhard
hello Bernard, no need to thank me for kind words, a library like this is much needed. Im actually considering of using it on a client project... Having this Shape issue implemented is highly important for any kind of procedural drawing. It would be amazing if you managed to implement this in the following days.
keep up the great work. thanks
Just i quick update. I did some work an Shape and Graphics and the width/height properties should be correct now. The changes need more testing, therefore the source is only available here on GitHub but not on Pub. Furthermore i need to do some more work to make the hit test work exactly like it does in Flash. Currently the hit test takes the bounding rectangle of the Shape, but in fact the bounds of the shape of the graphics needs to be checked. This will follow within the next few days.
I have finished the work on Graphics and Shapes. The Source is available on GitHub but not on Pub yet. I hope everything works as you expect. I will close this issue, but please don't hesitate to open a new one if anything does not work correct. Thanks for your feedback.
Bernhard
great work. incorporated your changes and am using your library in a client project now :) keep up the good work
Thanks for the feedback, this is good to know! I would love to see what you have done when you are finished.
it seems that when I draw inside of a Shape.graphic the resulting dimensions are not representative of the size of the drawing... both the width/height are 0 after the drawing operations. if you attach the Shape to the Sprite then, the Sprite itself also has resulting width/height == 0 as well...
as in as3, the dimensions should reflect the dimensions of the bounding box around the drawn shape.