Skip to content

qml: fix VideoGridItem image has wrong width

Fatih Uzunoğlu requested to merge fuzun/vlc:qt/stretchvideogriditem into master

PreserveAspectFit (default) or preserving the aspect ratio in general is not necessary here.

I'm not sure what is the reason for this, the source size aspect ratio is 1.60747663551401869159, while the actual image size aspect ratio is 1.6. I initially thought that this was the reason, but apparently it is not.

The source size aspect ratio should be the same of the image aspect ratio, but I don't plan to fix it here.

I suspect that this has something to do with Image's vertex shader [1] which does some kind of alignment so Image painted size does not reflect the absolute reality which ShaderEffect uses as basis for its own alignment.

For example, when the image's size is 456 x 283.35 its painted size is 453.04 x 283.35 (source size is 865 x 538). Even though PreserveAspectFit is used, the painted size aspect ratio does not seem to match source size aspect ratio.

[1] https://github.com/qt/qtdeclarative/blob/8f5aec5429f40ef23b6e7aa840d917d713fc613f/src/quick/scenegraph/shaders_ng/smoothtexture.vert

image

Request review @chub.

Merge request reports

Loading