Version: 1.6.0 (using KDE 3.5.5, Kubuntu (edgy) 4:3.5.5-0ubuntu3) Compiler: Target: i486-linux-gnu OS: Linux (i686) release 2.6.17-10-386 Importing a circle section does not look the way it is suppost to see according to the spec. The section and cut circle seem to be mixed up. See: http://testsuite.opendocumentfellowship.org/testcases/DrawingContent/Shapes/CircleSection/TestCase.html and http://testsuite.opendocumentfellowship.org/testcases/DrawingContent/Shapes/CutCircle/TestCase.html Note also that the rotation is incorrect.
Thanks for reporting. I looked at the circle code and it seems that cut and section are really mixed. The problem is not just the loading (or saving), but with the code which actullay creates the shape. So how do you think i should fix that? If i change the code which creates the shape, older documents will be broken. Otherwise i would only change the loading/saving of odg files, swapping the kind the type only there and we can really fix that for koffice 2. What do you think? Ciao Jan
Is it possible to create such a section withing karbon? I never found how as there are no tool options or something like that. If there is a way to create it, I'd say keep compatible within the 1.6 range and fix it for real in the 2.0 time. In 2.0 you can alter the old koffice fileformat to swap them for proper backwards compatibility.
It is possible, but not very obvious. :-) Just select the ellipse tool and single click onto the canvas. A options dialog should appear where you can set the kind, size, and start/end angle of the ellipse. I will change the odf loading/saving so that it will display the correct result.
SVN commit 601329 by jaham: fix reading and saving of circles from/to odg BUG:136497 M +20 -7 vellipse.cc --- branches/koffice/1.6/koffice/karbon/shapes/vellipse.cc #601328:601329 @@ -177,9 +177,11 @@ docWriter->addAttribute( "draw:kind", "full" ); else { - if( m_type == cut ) + // the meaning of cut and section is mixed up in karbon, so just set them so for now + // be sure to do the right thing tm for karbon 2.0 + if( m_type == section ) docWriter->addAttribute( "draw:kind", "cut" ); - else if( m_type == section ) + else if( m_type == cut ) docWriter->addAttribute( "draw:kind", "section" ); else docWriter->addAttribute( "draw:kind", "arc" ); @@ -237,21 +239,32 @@ else m_center.setY( m_ry + KoUnit::parseValue( element.attributeNS( KoXmlNS::svg, "y", QString::null ) ) ); - m_startAngle = element.attributeNS( KoXmlNS::draw, "start-angle", QString::null ).toDouble(); - m_endAngle = element.attributeNS( KoXmlNS::draw, "end-angle", QString::null ).toDouble(); - + // the meaning of cut and section is mixed up in karbon, so just set them so for now + // be sure to do the right thing tm for karbon 2.0 QString kind = element.attributeNS( KoXmlNS::draw, "kind", QString::null ); if( kind == "cut" ) + m_type = section; + else if( kind == "section" ) m_type = cut; - else if( kind == "section" ) - m_type = section; else if( kind == "arc" ) m_type = arc; else m_type = full; + double startAngle = element.attributeNS( KoXmlNS::draw, "start-angle", QString::null ).toDouble(); + double endAngle = element.attributeNS( KoXmlNS::draw, "end-angle", QString::null ).toDouble(); + + // the shape gets mirrored in y-direction, so make the angles temporary clockwise + // just for creating the path + m_startAngle = 360.0 - endAngle; + m_endAngle = 360.0 - startAngle; + init(); + // now set the right angles + m_startAngle = startAngle; + m_endAngle = endAngle; + transformByViewbox( element, element.attributeNS( KoXmlNS::svg, "viewBox", QString::null ) ); QString trafo = element.attributeNS( KoXmlNS::draw, "transform", QString::null );
You need to log in before you can comment on or make changes to this bug.