GithubHelp home page GithubHelp logo

Comments (6)

qadzek avatar qadzek commented on August 16, 2024 1

Thanks for the quick replies.

On the left, I was using Xviewer, which indeed seems Gtk-based.

Is there a GitHub repo where I can report this bug or should I do it on https://bugreports.qt.io? I have no experience with Qt.

from vimiv-qt.

karlch avatar karlch commented on August 16, 2024 1

I don't know of any Github repo that is more than just a mirror.

https://bugreports.qt.io/ is the way to go, thank you 😊

from vimiv-qt.

jcjgraf avatar jcjgraf commented on August 16, 2024

Thanks for reporting. I can reproduce the issue even with PyQt6 (did not try PySide6 though, but I also do not know if this could possibly make a difference).

Vimiv relies on QT to do the rendering of the SVGs. So there is nothing we can do about this. AI, under my directives, has created a MVE that illustrates the issue (scroll using the mouse wheel):

import sys
from PyQt6.QtWidgets import QGraphicsView, QGraphicsScene, QApplication
from PyQt6.QtSvgWidgets import QGraphicsSvgItem
from PyQt6.QtGui import QColor, QPainter

SVG_PATH = "./vimiv_problem.svg"


class CustomGraphicsView(QGraphicsView):
    def __init__(self):
        super().__init__()
        self.setRenderHints(
            QPainter.RenderHint.Antialiasing | QPainter.RenderHint.SmoothPixmapTransform
        )
        self.setTransformationAnchor(QGraphicsView.ViewportAnchor.AnchorUnderMouse)
        self.setResizeAnchor(QGraphicsView.ViewportAnchor.AnchorUnderMouse)

    def wheelEvent(self, event):
        zoom_factor = 1.2

        if event.angleDelta().y() > 0:
            self.scale(zoom_factor, zoom_factor)
        else:
            self.scale(1 / zoom_factor, 1 / zoom_factor)


def display_svg_image(file_path):
    app = QApplication(sys.argv)
    view = CustomGraphicsView()
    scene = QGraphicsScene()
    scene.setBackgroundBrush(QColor("darkgray"))
    svg_item = QGraphicsSvgItem(file_path)
    scene.addItem(svg_item)
    view.setScene(scene)
    view.show()
    sys.exit(app.exec())


if __name__ == "__main__":
    display_svg_image(SVG_PATH)

I suggest that you try some non-QT based rendered to rule-out a faulty SVG. If the issue is with QT, report it to upstream QT.

from vimiv-qt.

karlch avatar karlch commented on August 16, 2024

Thanks for reporting and thanks @jcjgraf for your quick and conclusive analysis! Exact same issues with PySide6.

I can only agree, and also remember that we had issues with Qt Svg before (see #423), so this is most likely a Qt issue. Especially as you show a perfectly fine screenshot with another imageviewer (Gtk-based I assume?) on the left.

I would second reporting upstream, that could be really helpful! The chance of us doing some internal workaround - or even not using Qt - are near zero. So I would flag and close this for now.

from vimiv-qt.

qadzek avatar qadzek commented on August 16, 2024

Thanks. The bug was reported: https://bugreports.qt.io/browse/QTBUG-122413

from vimiv-qt.

karlch avatar karlch commented on August 16, 2024

Thanks again for opening the issue on the Qt end. Sounds like this was actually recently solved by them. I currently don't have Qt 6.7 just yet, but will be sure to test it once I do and update here.

from vimiv-qt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.