From f76e1f57a85d973dd92124b7736e10aaaf31ce63 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Date: Fri, 13 May 2022 20:47:38 +0200 Subject: [PATCH] this fix wrong definition of ellipses circles --- src/object/sp-ellipse.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/object/sp-ellipse.cpp b/src/object/sp-ellipse.cpp index 129a52aaaf..843f88010e 100644 --- a/src/object/sp-ellipse.cpp +++ b/src/object/sp-ellipse.cpp @@ -55,7 +55,6 @@ void SPGenericEllipse::build(SPDocument *document, Inkscape::XML::Node *repr) { // std::cout << "SPGenericEllipse::build: Entrance: " << this->type // << " (" << g_quark_to_string(repr->code()) << ")" << std::endl; - switch ( type ) { case SP_GENERIC_ELLIPSE_ARC: this->readAttr(SPAttr::SODIPODI_CX); @@ -209,6 +208,24 @@ void SPGenericEllipse::update(SPCtx *ctx, guint flags) this->cy.update(em, ex, dy); this->rx.update(em, ex, dr); this->ry.update(em, ex, dr); + switch ( type ) { + case SP_GENERIC_ELLIPSE_CIRCLE: + if (this->getAttribute("rx")) { + this->setAttribute("r", this->getAttribute("rx")); + this->removeAttribute("rx"); + this->removeAttribute("ry"); + } + break; + case SP_GENERIC_ELLIPSE_ELLIPSE: + if (this->getAttribute("r")) { + this->setAttribute("rx",this->getAttribute("r")); + this->setAttribute("ry",this->getAttribute("r")); + this->removeAttribute("r"); + } + break; + default: + break; + } this->set_shape(); } -- GitLab