[OPEN] [#935] [2.5.3] Error when rendering Sprite

  1. #1

    [OPEN] [#935] [2.5.3] Error when rendering Sprite

    Hi,

    I came across this issue while trying to create some graphics using the DrawComponent.

    The Sprite class contains a Type config that can be assigned one of the options from the SpriteType enum.

    The error occurs when using an enum option that is not "native" to ExtJS. In my case it happened with Triangle.

    To reproduce the error, create a simple window or other component where DrawComponent can render to.

    public myDrawing()
            {
                Items.Add(new Sprite()
                {
                    Type = SpriteType.Triangle,
                    Fill = "green",
                    Stroke = "black"
                });
            }
    When the component is being created ExtJS calls the getBBox() function. Within this function it tries to create a variable realPath by combining strings. See the following line of code:

    var realPath = this["getPath" + sprite.type](sprite);
    Since ExtJS doesn't have a "getPathtriangle" function, the console throws the following error:

    Uncaught TypeError: this[("getPath" + sprite.type)] is not a function
    The error does not occur when the enum uses one of the ExtJS sprite types ( 'circle', 'ellipse', 'path', 'rect', 'text', 'image')

    Thanks,

    Carlos
    Last edited by Daniil; Nov 16, 2015 at 1:38 PM. Reason: [OPEN] [#935] [2.5.3]
  2. #2
    Hi @CarlosG,

    Thank you for the report!

    Created an Issue:
    https://github.com/extnet/Ext.NET/issues/935

    Most likely, this issue is not going to be fixed anytime soon, so, please turn to a Path Sprite to draw a triangle.

Similar Threads

  1. [CLOSED] [#549] Rendering Partial View Error
    By LAEUser in forum 2.x Legacy Premium Help
    Replies: 9
    Last Post: Oct 01, 2014, 12:36 PM
  2. [CLOSED] Error in rendering component columns in gridpanel.
    By PriceRightHTML5team in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Apr 22, 2014, 10:14 AM
  3. Replies: 2
    Last Post: Apr 04, 2014, 9:08 PM
  4. [CLOSED] Draggable Sprite
    By paulc in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: May 14, 2012, 7:58 PM
  5. [CLOSED] [1.0] Validation Error Rendering Issue
    By rcaunt in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Jan 13, 2012, 4:18 PM

Tags for this Thread

Posting Permissions