Skip to content
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

Crash when trying 9 patch.. #17

Closed
mwinters-stuff opened this issue Jan 8, 2015 · 1 comment
Closed

Crash when trying 9 patch.. #17

mwinters-stuff opened this issue Jan 8, 2015 · 1 comment

Comments

@mwinters-stuff
Copy link

This is my first try at the plugin, trying to create a 9patch which is an underline for a text header..
The plugin is crashing with a null pointer error.

My 9patch.json is

[
    {
        "name" : "header_underline",
        "stretch" : {
            "x" : [
                [0, 13],
            ],
            "y" : [
                [0, 63]
            ]
        },
            "content" : {
            "x" : [
                [0,13]
            ],
            "y" : [
                [64, 65]
            ]
          }
    }
]

the header_underline-xhdpi.svg is

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   width="14"
   height="66"
   id="svg2"
   version="1.1"
   inkscape:version="0.48.5 r10040"
   sodipodi:docname="header_underline-xhdpi.svg">
  <defs
     id="defs4" />
  <sodipodi:namedview
     id="base"
     pagecolor="#ffffff"
     bordercolor="#666666"
     borderopacity="1.0"
     inkscape:pageopacity="0.0"
     inkscape:pageshadow="2"
     inkscape:zoom="12.939394"
     inkscape:cx="-6.0222482"
     inkscape:cy="33"
     inkscape:document-units="px"
     inkscape:current-layer="layer1"
     showgrid="false"
     fit-margin-top="0"
     fit-margin-left="0"
     fit-margin-right="0"
     fit-margin-bottom="0"
     inkscape:snap-page="true"
     inkscape:window-width="1920"
     inkscape:window-height="1031"
     inkscape:window-x="0"
     inkscape:window-y="25"
     inkscape:window-maximized="1" />
  <metadata
     id="metadata7">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
        <dc:title></dc:title>
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <g
     inkscape:label="Layer 1"
     inkscape:groupmode="layer"
     id="layer1"
     transform="translate(-750.14288,-756.50507)">
    <path
       style="stroke:#ff00ff;stroke-width:2;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-start:none"
       d="m 751.33599,821.50507 c 6.7848,0 5.16639,0 11.9512,0"
       id="path3052"
       inkscape:connector-curvature="0"
       sodipodi:nodetypes="cc" />
  </g>
</svg>

What am I doing wrong?

@mwinters-stuff
Copy link
Author

Oops, copy-past bit me... I now found that I have left the comma on the first x, after copying the sample json and deleting the extra array items, I missed removing one comma, the JSON parser must add an null into the array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant