Dashed/dotted lines stop scaling with zoom once line thickness equals one pixel

• Aug 27, 2015 - 23:41

This is particularly obvious with the new "wide dashed" line style, but it also applies to the other dashed and dotted lines. To reproduce, add a "crescendo line" (as opposed to "crescendo hairpin"), which uses the "wide dashed" style, using the latest nightly build, and zoom in and out. On my system the line only stabilizes above 175% zoom.




On my system the scaling looks normal at 100% and larger - actually more like 75% and larger on my display. It's only at small zoom settings that it is drawn funny. I'm guessing because that is the point at which the line becomes literally one pixel wide and can't get any skinnier, so that one pixel it starts becoming proprotionately wider and thus makes the spacing wider too.

If so, I'd say that's just how it is - like anti-aliasing, just a fact of life with screen displays, especially low resolution screen displays. If you see any concerns in PDF or prints, let me know.

Well, I wouldn't expect the height to shrink past a certain point, but there must be a way to get the width to—that's what the whole concept of scaling is about.

The problem is, how Qt draws lines is mostly out of our control. We are telling Qt to draw a line five line-widths long, separated by a gap of 20 line-widths. Apparently Qt is deciding to take that literally, so that once the line width reaches one pixel, it just keeps that same 5 pixel length and 20 pixel gap even as everything shrinks around it, creating the optical illusion that the lines and gaps are actually growing. But I measured it on my system: once the line width reaches a minimum, the length and gap stay precisely constant even as everything else scales down.

I'm not saying this is absoutely what is going on, but it sure looks that way. If I were Qt, I'd scale these dashed lines to the "logical" line width - which might be less than one pixel - rather than the "physical" line width. We could even file a bug report with Qt, but then, there are probably other contexts in which the current behavior is desirable.

These sort of glitches are not particularly unusual, FWIW. Many programs I have used show similar artifacts when you scale things down to the point where the line thickness is one pixel.

Title Dashed/dotted lines shrink and grow in display except at high zoom Dashed/dotted lines stop scaling with zoom once line thickness equals one pixel

Well, given that even in screenshot mode image capture exports a correctly-scaled picture, I guess there's no harm done.