c-koi/gmic-qt

Preview widget resizes unstably on zoom

Closed this issue · 8 comments

Hi @c-koi,

This is to upstream bug 453947 in Krita; we've found that when the layer size is not strictly square, the preview widget varies wildly in size when the zoom level changes.

I couldn't understand where the resize happens at first glance, so I'm letting you know first.

The reporter used G'MIC 3.0.2, I verified the bug still happens in 3.1.2. According to the tarball log, this may happen as early as 2.9.2.

Hi @amyspark , after watching the animated .gif provided on https://bugs.kde.org/show_bug.cgi?id=453947 , I must admit we don't really understand the issue.
Could you please describe it with more details ? What is expected and what you get ?
Maybe record a video that shows the problem ?
Thanks.

Also, do you see a similar problem when running the problem in GIMP ?

Hey @dtschump, the problem is not reproducible in GIMP because its layers are always the size of the image.

2022-05-23_11-43-15.mp4

To reproduce the bug, one must use a non-square layer whose position is not (0, 0); for this, a transparent paint layer with a single stroke is enough. Then, with the layer selected, open G'MIC, and zoom in and out. You'll see in the example attached that the viewport starts changing sizes very wildly.

Hey @dtschump, the problem is not reproducible in GIMP because its layers are always the size of the image.

That is not true.
Layers in GIMP can be of any size.

Hey @dtschump, the problem is not reproducible in GIMP because its layers are always the size of the image.

That is not true. Layers in GIMP can be of any size.

Oh, it seems that the layer size is fixed at creation time. Then in GIMP 2.10 + G'MIC 3.1.2 I cannot reproduce the bug.

Oh, it seems that the layer size is fixed at creation time.

Not really, if you use the function 'Layers / Crop to content', a layer can be reshaped at any moment as well.

It's been broken since the inception of the Krita host in https://invent.kde.org/graphics/krita/-/commit/463213b8e04311f5c7f7c41e24cc198c5a98fb87. We never, ever accounted for the current layer mode, so we fed the Preview widget the size of the image (which obviously doesn't match in this case).

It's great to see this fixed, thanks @amyspark !