limweb / degrafa

Automatically exported from code.google.com/p/degrafa
1 stars 0 forks source link

Drawing AutoShapeTypeOffset failed because of null argument is passed from Geometry, #95

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create an GeometryGroup, and add it to some DisplayObjectContainer.
2. Create an AutoShapeTypeOffset (for example, the Trapezoid), and add it to 
the GeometryGroup
3. The Error #1009 )Cannot access a property or method of a null object 
reference) will be thrown.

What is the expected output? What do you see instead?
The shape should be draw with no error is thrown.

=== The sample code with this problem ===
package users.jatesadakarn
{
    import com.degrafa.GeometryGroup;
    import com.degrafa.geometry.autoshapes.TrapezoidAutoShape;
    import com.degrafa.paint.SolidFill;

    import flash.display.Sprite;
    import flash.events.Event;

    public class DegrafaTrapezoid extends Sprite
    {
        public function DegrafaTrapezoid()
        {
            super();
            addEventListener(Event.ADDED_TO_STAGE, onAddedToStage); 
        }

        private function onAddedToStage(e:Event):void
        {
            var geoGroup:GeometryGroup = new GeometryGroup();
            addChild(geoGroup);

            var trapezoid:TrapezoidAutoShape = new TrapezoidAutoShape();
            trapezoid.width = 200;
            trapezoid.height = 200;
            trapezoid.offset1 = 20;
            trapezoid.fill = new SolidFill(0);
            geoGroup.geometryCollection.addItem(trapezoid);
        }
    }
}

=== Stack trace ===
TypeError: Error #1009: Cannot access a property or method of a null object 
reference.
    at com.degrafa.geometry.layout::LayoutConstraint/computeLayoutRectangle()[C:\Users\Greg\eclipseWorkspace\DegrafaFlex4\Degrafa\com\degrafa\geometry\layout\LayoutConstraint.as:497]
    at com.degrafa.geometry::Geometry/calculateLayout()[C:\Users\Greg\eclipseWorkspace\DegrafaFlex4\Degrafa\com\degrafa\geometry\Geometry.as:1016]
    at com.degrafa.geometry.autoshapes::AutoShapeTypeOffsets/calculateLayout()[C:\Users\Greg\eclipseWorkspace\DegrafaFlex4\Degrafa\com\degrafa\geometry\autoshapes\AutoShapeTypeOffsets.as:242]
    at com.degrafa.geometry.autoshapes::AutoShapeTypeOffsets/draw()[C:\Users\Greg\eclipseWorkspace\DegrafaFlex4\Degrafa\com\degrafa\geometry\autoshapes\AutoShapeTypeOffsets.as:258]
    at com.degrafa::GeometryGroup/draw()[C:\Users\Greg\eclipseWorkspace\DegrafaFlex4\Degrafa\com\degrafa\GeometryGroup.as:137]
    at com.degrafa::GeometryGroup/propertyChangeHandler()[C:\Users\Greg\eclipseWorkspace\DegrafaFlex4\Degrafa\com\degrafa\GeometryGroup.as:113]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at com.degrafa.core::DegrafaObject/dispatchEvent()[C:\Users\Greg\eclipseWorkspace\DegrafaFlex4\Degrafa\com\degrafa\core\DegrafaObject.as:109]
    at com.degrafa.core::DegrafaObject/dispatchPropertyChange()[C:\Users\Greg\eclipseWorkspace\DegrafaFlex4\Degrafa\com\degrafa\core\DegrafaObject.as:146]
    at com.degrafa.core::DegrafaObject/initChange()[C:\Users\Greg\eclipseWorkspace\DegrafaFlex4\Degrafa\com\degrafa\core\DegrafaObject.as:154]
    at com.degrafa.core.collections::DegrafaCollection/concat()[C:\Users\Greg\eclipseWorkspace\DegrafaFlex4\Degrafa\com\degrafa\core\collections\DegrafaCollection.as:329]
    at com.degrafa.core.collections::DegrafaCollection/_addItem()[C:\Users\Greg\eclipseWorkspace\DegrafaFlex4\Degrafa\com\degrafa\core\collections\DegrafaCollection.as:151]
    at com.degrafa.core.collections::GeometryCollection/addItem()[C:\Users\Greg\eclipseWorkspace\DegrafaFlex4\Degrafa\com\degrafa\core\collections\GeometryCollection.as:54]
    at users.jatesadakarn::DegrafaTrapezoid/onAddedToStage()[D:\Project\DegrafaTrapezoid.as:27]

Original issue reported on code.google.com by champ....@gmail.com on 8 Dec 2010 at 9:20

GoogleCodeExporter commented 9 years ago
Sorry, I forgot to include my environment to the issue.

* Windows 7
* Flex 4
* DegrafaFlex4.swc (as downloadable from the download page)

Original comment by champ....@gmail.com on 8 Dec 2010 at 9:23

GoogleCodeExporter commented 9 years ago
I have the same issue. 

* Windows 7
* Flex 4.5
* Air 2.5.1
* DegrafaFlex4.swc

Original comment by rgom...@gmail.com on 3 Jan 2011 at 3:48

GoogleCodeExporter commented 9 years ago
Same issue

* Mac OS 10.6.6
* Flex 4.1
* Using compiled src from 
http://degrafa.googlecode.com/svn/branches/V1_Development/Degrafa_Flex4/Degrafa 
revision 639

Original comment by Kenny.Rothwell on 28 Jan 2011 at 2:11

GoogleCodeExporter commented 9 years ago
I am hoping someone will acknowledge this is a bug...I see the problem in the 
base Geometry:caculateLayout() when using a BezierCurve using Beta 3.2.  
Problem doesn't exist in Beta 3.1.  I stepped through the Degrafa 3.2 source 
but having a hard time figuring out the root cause.

Original comment by Kenny.Rothwell on 9 Feb 2011 at 6:33

GoogleCodeExporter commented 9 years ago
TypeError: Error #1009: Cannot access a property or method of a null object 
reference.
    at com.degrafa.geometry.layout::LayoutConstraint/computeLayoutRectangle()[/Users/krothwel/Documents/Adobe Flash Builder 4/convertem/src/com/degrafa/geometry/layout/LayoutConstraint.as:497]
    at com.degrafa.geometry::Geometry/calculateLayout()[/Users/krothwel/Documents/Adobe Flash Builder 4/convertem/src/com/degrafa/geometry/Geometry.as:997]
    at com.degrafa.geometry::CubicBezier/calculateLayout()[/Users/krothwel/Documents/Adobe Flash Builder 4/convertem/src/com/degrafa/geometry/CubicBezier.as:312]
    at com.degrafa.geometry::CubicBezier/draw()[/Users/krothwel/Documents/Adobe Flash Builder 4/convertem/src/com/degrafa/geometry/CubicBezier.as:333]
    at com.degrafa::GeometryGroup/draw()[/Users/krothwel/Documents/Adobe Flash Builder 4/convertem/src/com/degrafa/GeometryGroup.as:137]
    at com.degrafa::Graphic/set target()[/Users/krothwel/Documents/Adobe Flash Builder 4/convertem/src/com/degrafa/Graphic.as:174]

....

Original comment by Kenny.Rothwell on 9 Feb 2011 at 6:41

GoogleCodeExporter commented 9 years ago
Iam also facing this issue. Please help me out here//

TypeError: Error #1009: Cannot access a property or method of a null object 
reference.
    at com.degrafa.geometry.layout::LayoutConstraint/computeLayoutRectangle()[C:\Users\Greg\eclipseWorkspace\DegrafaFlex4\Degrafa\com\degrafa\geometry\layout\LayoutConstraint.as:497]
    at com.degrafa.geometry::Geometry/calculateLayout()[C:\Users\Greg\eclipseWorkspace\DegrafaFlex4\Degrafa\com\degrafa\geometry\Geometry.as:1016]
    at com.degrafa.geometry::Ellipse/calculateLayout()[C:\Users\Greg\eclipseWorkspace\DegrafaFlex4\Degrafa\com\degrafa\geometry\Ellipse.as:241]
    at com.degrafa.geometry::Ellipse/draw()[C:\Users\Greg\eclipseWorkspace\DegrafaFlex4\Degrafa\com\degrafa\geometry\Ellipse.as:266]
    at com.degrafa::GeometryGroup/draw()[C:\Users\Greg\eclipseWorkspace\DegrafaFlex4\Degrafa\com\degrafa\GeometryGroup.as:137]
    at com.degrafa::GeometryGroup/propertyChangeHandler()[C:\Users\Greg\eclipseWorkspace\DegrafaFlex4\Degrafa\com\degrafa\GeometryGroup.as:113]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at com.degrafa.core::DegrafaObject/dispatchEvent()[C:\Users\Greg\eclipseWorkspace\DegrafaFlex4\Degrafa\com\degrafa\core\DegrafaObject.as:109]
    at com.degrafa.core::DegrafaObject/dispatchPropertyChange()[C:\Users\Greg\eclipseWorkspace\DegrafaFlex4\Degrafa\com\degrafa\core\DegrafaObject.as:146]
    at com.degrafa.core::DegrafaObject/initChange()[C:\Users\Greg\eclipseWorkspace\DegrafaFlex4\Degrafa\com\degrafa\core\DegrafaObject.as:154]
    at com.degrafa.core.collections::DegrafaCollection/concat()[C:\Users\Greg\eclipseWorkspace\DegrafaFlex4\Degrafa\com\degrafa\core\collections\DegrafaCollection.as:329]
    at com.degrafa.core.collections::DegrafaCollection/_addItem()[C:\Users\Greg\eclipseWorkspace\DegrafaFlex4\Degrafa\com\degrafa\core\collections\DegrafaCollection.as:151]
    at com.degrafa.core.collections::GeometryCollection/addItem()[C:\Users\Greg\eclipseWorkspace\DegrafaFlex4\Degrafa\com\degrafa\core\collections\GeometryCollection.as:54]
    at com.degrafa.SVGRender::SVGToGeometry/personalizeObject()[D:\Ekahau\code\flex-new-client\24_July_11\src\com\degrafa\SVGRender\SVGToGeometry.as:59]
    at com.degrafa.SVGRender.SVGRead::SVGRender/visitEllipse()[D:\Ekahau\code\flex-new-client\24_July_11\src\com\degrafa\SVGRender\SVGRead\SVGRender.as:462]
    at com.degrafa.SVGRender.SVGRead::SVGRender/visit()[D:\Ekahau\code\flex-new-client\24_July_11\src\com\degrafa\SVGRender\SVGRead\SVGRender.as:111]
    at com.degrafa.SVGRender.SVGRead::SVGRender/visitG()[D:\Ekahau\code\flex-new-client\24_July_11\src\com\degrafa\SVGRender\SVGRead\SVGRender.as:204]
    at com.degrafa.SVGRender.SVGRead::SVGRender/visit()[D:\Ekahau\code\flex-new-client\24_July_11\src\com\degrafa\SVGRender\SVGRead\SVGRender.as:115]
    at com.degrafa.SVGRender.SVGRead::SVGRender/visitSvg()[D:\Ekahau\code\flex-new-client\24_July_11\src\com\degrafa\SVGRender\SVGRead\SVGRender.as:154]
    at com.degrafa.SVGRender.SVGRead::SVGRender/visit()[D:\Ekahau\code\flex-new-client\24_July_11\src\com\degrafa\SVGRender\SVGRead\SVGRender.as:81]
    at com.degrafa.SVGRender::SVGToGeometry/cargar()[D:\Ekahau\code\flex-new-client\24_July_11\src\com\degrafa\SVGRender\SVGToGeometry.as:46]

Original comment by jjain.ji...@gmail.com on 4 Oct 2011 at 10:59