gotcha

Author Topic: Potential xml editor bug  (Read 370 times)

March 24, 2019, 03:00:40 PM
Read 370 times

vanepp

  • Sr. Newbie

  • Offline
  • **

  • 5
I think this is a so far unreported xml editor bug. As requested in the bug reporting documentation I'm posting it here to see if I just haven't searched the bug databases correctly before reporting it. Fritzing (the eda package I'm using Inkscape for) doesn't fully support style. Thus I have a python script that converts style commands to inline xml (I know Inkscape will do this if I select optimized svg, but that  causes other problems in Fritzing). That script converted this svg from style to inline xml:

xml-editor-bug-orig.svg
*xml-editor-bug-orig.svg
(1.78 kB . 210x297)
(viewed 83 times)


If you load this svg and in xml editor you select line24 and change stroke-width from 0.24694389 to 10 and press set, you will get:

style fill:none;stroke:#787878;stroke-width:0.24694389;stroke-linecap:round;stroke-linejoin:round

note the inline parameters have been converted to a style correctly but the stroke-width setting has remained 0.24694389 instead of changing to the requested 10. Can anyone find this reported as a bug (or have a reason why it isn't a bug?) I searched on xml-editor in the bug databases and didn't come up with anything but perhaps that is the wrong search term.

Peter
  • 0.92.4
  • Win 7 Pro 64 bit

March 24, 2019, 05:14:26 PM
Reply #1

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
It's not because we don't trust people's searching skills to find previously reported bugs.  We like to look at them first, because so many users think they have found a bug, when really they just haven't learned how to use the program.  In my experience, I'd estimate 8 out of 10 messages where people think they found a bug, turn out they just haven't learned how to do something correctly.  Or sometimes the problem is not where they thought it was, or well, in general, it cuts down on work by the bug managers, if we can sort of filter out some of the noise.

Hhm, this one is a bit over my head.  On the surface, I agree that it does look buggish.  But you still have the scale problem in the file, that I mentioned to you in your other topic.

Fixing the scale problem changes the inline parameters.  And after that, changing the width seems to work as expected.

But XML in general, and the XML Editor specifically are a little too far over my head, for me to be able to say whether the problem you see is related to the incorrect scale, or if there's something else affecting the issue.  If I understand you correctly, the "Line" object (which afaik, Inkscape can't create) is a result of a script which you used on a file from another program?  So there could be something about that, which is serving as the "wrench" in the works (as they say).

Or it could be yet something else affecting it.  For example, if I don't fix the scale first, and I follow your steps to change the width in the XML Editor, yes, I do see the problem.  But if I Undo it, on the canvas, the width suddenly changes!  Even though the XML Editor still shows the original width, the line on the canvas becomes huge, and is reported on the canvas as 10 (even though undoing should have put it back to the original  :???: )

So  there is something funky going on, somewhere.  But much of it is beyond my abilities to pinpoint.

Are you able to fix the scale issue before you paste in the XML?  That would be a good first step to narrow it down.

Also, someone else should be along, before too long, who either might know somthing about whether it's been reported, or would have the right skills to sort out exactly where the problem is.

(Regarding searching, the Launchpad search is known to be horrible.  I can search on words that I know I wrote in a bug title, in LP, and not find the report!  We are still fairly new at using gitlab for a bug tracker, so it's not clear how well it's able to search.  So far, so good, but it doesn't have 5000 reports yet, so time will tell.  But LP is definitely hard to search!)
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

March 24, 2019, 08:56:23 PM
Reply #2

vanepp

  • Sr. Newbie

  • Offline
  • **

  • 5
Well as usual this is being fun! I had assumed a bug report would want the default settings, but the default settings on both 92.3 and 92.4 (which is what I'm currently running) set the Display Units to mm on install (I uninstalled 9.4 and reinstalled it, then uninstalled and installed 0.92.3 then back to the current 0.92.4). Interestingly the exe installer has different options than the msi installer (I tried them too). All the Fritzing svgs I tried (and all that I'm aware of) use Display Units px (with varying scales). But back to the present case. I created a blank document and changed display Units from mm to px, Custom Units to in and scale to 1 (rather than my standard 10.41667.) Something in that series (likely the rescale) converted the inline XML to a style giving me this document:

xml-editor-bug-orig.svg
*xml-editor-bug-orig.svg
(0.96 kB . 8x11)
(viewed 73 times)


Since that is now styled I ran it through the python script (which uses lxml for xml parsing same as Inkscape)  to inline the style again giving this document:

xml-editor-bug-base.svg
*xml-editor-bug-base.svg
(0.97 kB . 8x11)
(viewed 75 times)


For me using xml-editor-bug-base.svg the bug appears to be present. I set a page grid and adjusted the offset so the line is exactly between 2 grid lines (as it is .01 in wide) as shown in this screen shot:

initial.PNG
*initial.PNG
(150.98 kB . 1011x691)
(viewed 121 times)


then set up to change the stroke-width:

before-set.PNG
*before-set.PNG
(148.09 kB . 1010x687)
(viewed 84 times)


which results in a style with the stroke width unchanged in either the xml editor or the drawing (at least as far as I can see):

after-set.PNG
*after-set.PNG
(147.41 kB . 1007x691)
(viewed 92 times)


to work around this I now have to change the stroke-width in the style which does change the stroke width correctly.

stroke-width-changed.PNG
*stroke-width-changed.PNG
(159.94 kB . 1229x669)
(viewed 96 times)


Hope this helps.

Peter

  • 0.92.4
  • Win 7 Pro 64 bit

March 24, 2019, 09:13:22 PM
Reply #3

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Hah!  Well by this point, I'm a little bit lost.  But I do feel like you understand enough to recognize that there might be a bug, and to set up a basic document or basic configuration to be able to present a good bug report.

Maybe a more advanced user will reply here, I'm not sure (being a bit lost).  But if you feel a report is needed, please feel free.  They go here:  https://gitlab.com/inkscape/inbox/issues  And click on the green New Issue button.
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann