MonkSVG icon indicating copy to clipboard operation
MonkSVG copied to clipboard

A simple Line bug?

Open gerchicov opened this issue 11 years ago • 5 comments

void SVG::handle_line(TiXmlElement *element) {

    _handler->onPathBegin();
    float x1, x2, y1, y2;
    element->QueryFloatAttribute("x1", &x1);
    element->QueryFloatAttribute("y1", &y1);
    element->QueryFloatAttribute("x2", &x2);
    element->QueryFloatAttribute("y2", &y2);
    _handler->onLine(x1, y1, x2, y2);

// _handler->onPathMoveTo(x1, y1); // _handler->onPathLineTo(x2, y2); handle_general_parameter(element); _handler->onPathEnd(); }

void OpenVG_SVGHandler::onLine(float x1, float y1, float x2, float y2) {

    vguLine(_current_group->current_path->path, x1, y1, x2, y2);
}

I added these methods. because a simple line tag is unimplemented. And onLine must work as onPathMoveTo + onPathLineTo and it must be correct. But they both work incorrectly and... differently?!

gerchicov avatar Oct 18 '13 14:10 gerchicov

here is a link to an example of file: http://www.filehostfree.com/?d=526146EC1

gerchicov avatar Oct 18 '13 14:10 gerchicov

Can you submit this as a pull request?

micahpearlman avatar Oct 19 '13 16:10 micahpearlman

I'm sorry but I can't because: 1)I simply don't know how to do this 2)if you mean all my changes (not these only) to this library then I can't send all of them because of agreement with my employer.

additionally I saw that if line tag is defined before path tag then it works.

gerchicov avatar Oct 21 '13 06:10 gerchicov

I think I have found a problem but I still don't know how to fix it. And I don't know is it in my code or your own. The problem is when I draw path attribute (in example file) I use a relative mode for the last coordinates. Then I try to draw line attribute in an absolute mode. So I need to reset this mode to default or manually set it to relative before the line drawing. Or there is even error in your code in vguLine in MonkVG (it always sets VG_ABSOLUTE mode).

gerchicov avatar Oct 21 '13 08:10 gerchicov

Hello, can you create an example of a project which could push/pop a view controller which shows svg? I think I have found a bug with memory management but I'm not assure that it isn't my own bug.

gerchicov avatar Oct 30 '13 12:10 gerchicov