https://bugs.kde.org/show_bug.cgi?id=439156

--- Comment #9 from Leonardo <odraenco...@gmail.com> ---
(In reply to Halla Rempt from comment #8)
>It's more complicated than that, because the zoom levels aren't hard-coded, 
>but calculated
>KoZoomAction::Private::generateSliderZoomLevels().

Is this the code for it?

https://invent.kde.org/graphics/krita/-/blob/master/libs/widgets/KoZoomAction.cpp#L63

It seems to be already hard-coded.

    QList<qreal> zoomLevels;

    qreal defaultZoomStep = sqrt(2.0);

    zoomLevels << 0.25 / 2.0;
    zoomLevels << 0.25 / 1.5;
    zoomLevels << 0.25;
    zoomLevels << 1.0 / 3.0;
    zoomLevels << 0.5;
    zoomLevels << 2.0 / 3.0;
    zoomLevels << 1.0;

See, that's 100%, 67% (2/3), 50% (0.5), 33% (1/3), 25% (0.25), 17% (0.25 / 1.5)
and 13% (0.25 / 2.0).

For some reason the first zoom levels smaller than 100% are hard-coded, but the
ones larger than 100% aren't hard-coded. You could fix this issue by simply
adding something like:

    zoomLevels << 1.5;
    zoomLevels << 2.0;
    zoomLevels << 3.0;
    zoomLevels << 4.0;
    zoomLevels << 5.5;
    zoomLevels << 8.0;

I say this is an UX issue because without using whole numbers for zoom levels
the size of the pixels on display becomes unequal in unpredictable ways. It
isn't much of an issue with high zoom levels like 550%, but with 283%, for
example, some pixels are scaled into 3x3 squares, while others become 2x2
squares, and others become 2x3 or 3x2 rectangles. Consequently, if you draw a
line, some pixels of the line appear bigger than others randomly, so some parts
of the line appear thicker randomly, which gives the jagged appearance. This
jagged appearance isn't expected by the user, so they'll think the brush isn't
drawing right, or krita isn't anti-aliasing right, etc., until they figure out
the zoom is weird in krita.

Probably unnecessary, but for zoom levels higher than 800% one could adjust the
calculated levels to round to the nearest 50%, e.g. by changing this:

    zoomLevels.append(zoom);

To something like this:

    zoomLevels.append(whatever_round_to_nearest_integer_is_called_in_cpp(zoom *
2) / 2.0);

In fact if you did this you wouldn't even need to hard code the zoom levels
since 141%, 283%, and 566% round to the 150%, 300%, and 550% anyway.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to