Menu

1.5beta bug

Help
peppe
2007-04-03
2013-04-17
  • peppe

    peppe - 2007-04-03

    In a svg file, when "transform =translate..." attribute is added in tag <g> it not works, while in glips graffiti 1.4 it works fine...

     
    • Jordi

      Jordi - 2007-04-03

      Thank you for the bug notice, the bug has been fixed.

       
    • peppe

      peppe - 2007-04-04

      do you can say me where is the bug and how can i solve it?

       
      • Jordi

        Jordi - 2007-04-04

        In the class "SVGDOMNormalizer", replace the "normalizeGroupNode(Element g)" method by this one :

            public void normalizeGroupNode(Element g){
               
                //getting the transform attribute value of the group element
                String mainTransformValue=g.getAttribute(transformAtt).trim();
               
                if(! mainTransformValue.equals("")){
                   
                    mainTransformValue+=" ";
                    g.removeAttribute(transformAtt);
                   
                    //concatenating this value to the transform attribute
                    //value of each child of the element
                    String transformValue="";
                    NodeList childNodes=g.getChildNodes();
                    Node node=null;
                    Element element=null;
                   
                    for(int i=0; i<childNodes.getLength(); i++){
                       
                        node=childNodes.item(i);
                       
                        if(node instanceof Element){
                           
                            element=(Element)node;
                           
                            //getting the transform attribute value
                            transformValue=element.getAttribute(transformAtt).trim();
                           
                            //setting the new transform value
                            transformValue=mainTransformValue+transformValue;
                            element.setAttribute(transformAtt, transformValue);
                        }
                    }
                }
            }

         

Log in to post a comment.