Drawing at high zoom produces corrupt shapes

This is NOT a support forum. You are welcome to discuss software issues here, but all issues should be reported on Launchpad if you want them fixed.
chrisjj
Posts: 153
Joined: Thu Jan 17, 2013 10:45 am

Drawing at high zoom produces corrupt shapes

Postby chrisjj » Wed Jan 30, 2013 8:51 pm

Does anyone else find that shapes drawn at high zoom e.g. 6400% are corrupt? E.g. a rectangle:

Image

This is not just a display issue - if I scale the shape up by 6400%, the corruption remains.

And some such shapes change their appearance on change of zoom, e.g.

Image

Image

This is on Inkscape 0.48.4 r9939, Win 7 Pro 64-bit.
Last edited by chrisjj on Thu Jan 31, 2013 2:47 am, edited 1 time in total.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Drawing at high zoom produces corrupt shapes

Postby brynn » Thu Jan 31, 2013 2:44 am

It's hard to say what the problem is, just from your screenshots. We don't know what the objects that you've showed us are supposed to look like. It does look like a display issue, especially if zooming is causing the problem....except that those aren't extremely high zoooms. Depending on your perspective, even 6400% could be considered a moderate zoom. But again, we really have no idea what's in the file.

If it's not a display issue, then the problem must be in the file....unless this is a bug. Would you please provide the SVG file for us? You could attach to a reply or upload wherever you choose, and give us the link. Make sure it's a file that exhibits the problem :D

chrisjj
Posts: 153
Joined: Thu Jan 17, 2013 10:45 am

Re: Drawing at high zoom produces corrupt shapes

Postby chrisjj » Thu Jan 31, 2013 2:54 am

brynn wrote:It's hard to say what the problem is, just from your screenshots. We don't know what the objects that you've showed us are supposed to look like.

It is supposed to be a rectangle.

brynn wrote:If it's not a display issue, then the problem must be in the file....unless this is a bug. Would you please provide the SVG file for us? You could attach to a reply

I didn't save it, but trying again, I get a different non-rectangle:

Image

and attached is the .SVG.

Thanks.
Attachments
failure of rectangle drawn in 6400% zoom.svg
(1.83 KiB) Downloaded 218 times

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: Drawing at high zoom produces corrupt shapes

Postby ragstian » Thu Jan 31, 2013 3:00 am

Hi.

At this high zoom the stroke width seems to cause problems. Try setting your stroke width to 0.01 or even 0.001 pixel.
Your rectangle in the file provided shows up as a blue rectangle with black stroke and rounded corners at the maximum zoom of 25600% (using a 2560 x 1440 pixel screen.)

Good Luck

RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

chrisjj
Posts: 153
Joined: Thu Jan 17, 2013 10:45 am

Re: Drawing at high zoom produces corrupt shapes

Postby chrisjj » Thu Jan 31, 2013 3:12 am

ragstian wrote:At this high zoom the stroke width seems to cause problems.

Note that this error is visible even at 10x i.e. 1000%.

ragstian wrote:Try setting your stroke width to 0.01 or even 0.001 pixel.

Thanks. Any suggestion for a workaround that doesn't lose the stroke?

ragstian wrote:Your rectangle in the file provided shows up as a blue rectangle with black stroke and rounded corners at the maximum zoom of 25600%

Whoops. Seems like we have another problem. Here, it shows up exactly as the screenshot. Are you using the same release - the current production release, 0.48.4 r9939 ?

v1nce
Posts: 696
Joined: Wed Jan 13, 2010 4:36 am

Re: Drawing at high zoom produces corrupt shapes

Postby v1nce » Thu Jan 31, 2013 3:16 am

From the source of the svg it's not a pure rect it's a rect with rounded corner.
Plus the stroke is 32 times larger (2px) than the width of rect (0.0625).
So the left border overlaps the right border.

Maybe the stroke filling algorithm is suboptimal but so is the input svg ;)

chrisjj
Posts: 153
Joined: Thu Jan 17, 2013 10:45 am

Re: Drawing at high zoom produces corrupt shapes

Postby chrisjj » Thu Jan 31, 2013 3:38 am

v1nce wrote:From the source of the svg it's not a pure rect it's a rect with rounded corner.


Oops - my oversight. I'd not spotted that Rx and Ry were non-zero. How they got set, I cannot fathom. Sorry.

Perhaps this fault is due to rounded corners going haywire. I shall have another go at recreating the first example, but meanwhile here's a variation:

Image

SVG attached.
Attachments
spikes on 'round'-corner rectangle.svg
(2.23 KiB) Downloaded 214 times

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Drawing at high zoom produces corrupt shapes

Postby brynn » Thu Jan 31, 2013 4:28 am

It's the same problem as before. The rectangle has round corners.

When you're working with objects that small, you'll need to use very, very narrow stroke widths. Try changing the stroke width to 0.002 on the last file you provided. Then you can see that the corners are rounded.

I think you'd see the same distortions, if you were working at a larger scale, presuming you kept the stroke width proportional to the scale. Here, check this file. I used Object menu > Transform > Scale and scaled 10000.00% (or x 100) (times 100). Then I multiplied the stroke width, which was 0.400, by 100, making it 40.00. See? Same thing :D

spikes on 'round'-corner rectangle-2.svg
(2.6 KiB) Downloaded 226 times

So it's not a problem at all. That's exactly what a rectangle, with the rounded corners that you've configured, with that wide of a stroke width, should look like. Try drawing it on paper (assuming you could draw so precisely) and it would look the same way -- as long as you use that wide of a stroke relative to the size of the object. So in other words, your stroke width is larger than your object itself!

Edit
Well, not a problem with Inkscape. More of a problem with having the width larger than the object :D

chrisjj
Posts: 153
Joined: Thu Jan 17, 2013 10:45 am

Re: Drawing at high zoom produces corrupt shapes

Postby chrisjj » Thu Jan 31, 2013 4:43 am

brynn wrote:It's the same problem as before. The rectangle has round corners.

Well, you'd hope so - since that is what was requested. Unfortunately what the rectangle has instead is spikes that reach outsidethe boundary of the shape.

Note that as the rectangle is narrowed, the spikes suddenly disappear.

Likewise the effect is unstable with respect to Zoom. Zoom out, and it disappears.

brynn wrote:When you're working with objects that small, you'll need to use very, very narrow stroke widths.


Until this is fixed, I shall be sure to do so. Thanks for the warning.

brynn wrote:So it's not a problem at all.


Thanks for the suggestion! :)

chrisjj
Posts: 153
Joined: Thu Jan 17, 2013 10:45 am

Re: Drawing at high zoom produces corrupt shapes

Postby chrisjj » Thu Jan 31, 2013 8:42 pm

Thanks. Join is Miter. Other Joins are OK.

> Miter joints have a nasty habit of showing "pointy" corners especially at acute angles.

There shouldn't be any acute angles in these rounded 90deg corners... but indeed there are. It seems the rounding segments the corner into lines of equal length, except the last line can wildy overshoot.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Drawing at high zoom produces corrupt shapes

Postby brynn » Sat Feb 02, 2013 3:25 pm

If you have a stroke width that's wider than the object, it can't possibly be drawn correctly. I don't know if changing the miter limit will help in that case.... Ok, let me do a quick test... Well, changing the miter limit does affect how this object is displayed. I took it down to 0.00, and then went slowly up from there. Around 1.10 it starts to change, and then it drastically changes around 2.2. But I don't think it's displayed correctly at any miter limit.

I don't know if this would be considered a bug or not. Perhaps it is. But I still don't know how any object could be displayed correctly, when the stroke is as wide, or wider than the object itself. And I can't think of any reason why anyone would want to have a stroke width that is wider than the object.

If you're using the stroke to make the object larger, maybe you could scale the object itself?

chrisjj
Posts: 153
Joined: Thu Jan 17, 2013 10:45 am

Re: Drawing at high zoom produces corrupt shapes

Postby chrisjj » Sat Feb 02, 2013 9:14 pm

brynn wrote:If you have a stroke width that's wider than the object, it can't possibly be drawn correctly.

I guess that is certainly true for at least one definition of "correctly". I think it is not true for all.

brynn wrote:I don't know if this would be considered a bug or not. Perhaps it is.

I think the fact the shape is unstable with respect to zoom (e.g. at 3330% the spikes disappear) means there's a bug.
Last edited by chrisjj on Sun Feb 03, 2013 12:04 pm, edited 1 time in total.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Drawing at high zoom produces corrupt shapes

Postby brynn » Sun Feb 03, 2013 6:33 am

I don't think the part about the zoom causing the problem is correct. ....well, maybe zoom, alone.... The file I attached is at 100% zoom. (I scaled the object by a factor of 100, so it could be shown at 100% zoom, and then increased the stroke width by the same 100.) (I had to scale the stroke separately, because I have mine set not to scale the stroke width when the object is scaled.)

So maybe there are a couple of issues happening here?

chrisjj
Posts: 153
Joined: Thu Jan 17, 2013 10:45 am

Re: Drawing at high zoom produces corrupt shapes

Postby chrisjj » Sun Feb 03, 2013 12:07 pm

brynn wrote:I don't think the part about the zoom causing the problem is correct. ....well, maybe zoom, alone.... The file I attached is at 100% zoom.


The instability on zoom may not show on the file you attached, but it does show on the file I attached - here

[moderator edit -- link removed]

EDIT: viewtopic.php?p=51719#p51719
Last edited by chrisjj on Sun Feb 03, 2013 9:52 pm, edited 2 times in total.

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: Drawing at high zoom produces corrupt shapes

Postby ragstian » Sun Feb 03, 2013 12:23 pm

Hi chrisjj

The link you posted is incorrect - it opens brynn's last post for edit.

RGDS
Raganr
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Drawing at high zoom produces corrupt shapes

Postby brynn » Sun Feb 03, 2013 8:48 pm

Yikes, chrisjj shouldn't have access to edit my messages! Let me investigate, and I'll brb :D (or you anyone, except another mod or admin)

Edit
Well, I have no idea how that was possible! But I don't think it should be possible. So I've removed the link, since it probably was a mistake anyway. Please let me know if anyone objects :D Thanks

chrisjj
Posts: 153
Joined: Thu Jan 17, 2013 10:45 am

Re: Drawing at high zoom produces corrupt shapes

Postby chrisjj » Sun Feb 03, 2013 9:54 pm

ragstian wrote:The link you posted is incorrect - it opens brynn's last post for edit.
Coo... I've no idea how that happened. Thanks for the heads up. I have added the correct link.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Drawing at high zoom produces corrupt shapes

Postby brynn » Sun Feb 03, 2013 10:23 pm

So yes, I agee. Maybe there is more than one issue involved in this strange display?


Return to “Discuss Software Issues”