Skip to content

Maximum Zoom In causes improper node rendering #121

Open

Description

@EssenOH

Reproducing Steps.

  1. make couple of nodes ( good example is image loader & display node )
  2. scale up one of the display node to occupy half of window from default
  3. zoom in the view to maximum and scroll.

bug : it doesn't properly render the big display node and the image area looks a proper size, but node widget size is getting smaller to hold the image area and it doesn't the node properly.

Activity

  1. EssenOH commented on Oct 4, 2017

    @EssenOH
    Author

    Exactly, the biggest node doesn't draw half where is bottom end.

  2. navyenzo commented on Jul 18, 2018

    @navyenzo

    anybody figured out how to fix this problem?

  3. Malcohol commented on Jul 30, 2019

    @Malcohol
    Contributor

    I think I'm hitting the same bug and I've been investigating.

    It seems to be connected to the caching of QGraphicsItems. Specifically, it's directly affected by the call to setCacheMode in the NodeGraphicsObject constructor.

    From playing around with an ImageShowModel node from the samples, it seems that when you zoom a big node, so that its actual size is bigger than the window would be, it gets clipped. I suspect there's a limit on how big a cache can be and the size for the DeviceCoordinateCache case is around the size of the window.

    Notes:

    • If you comment out the setCacheMode line, the problem goes away, but the performance of large scenes will suffer.
    • If you change the mode to ItemCoordinateCache, then problem goes away, but rendering quality suffers.
    • A cache size is ignored in the case of DeviceCoordinateCache.

    I suspect this may be a Qt bug and that the proper behaviour is that the cache should not be used if it is not big enough. I'm not 100% sure and I don't have time to take it any further tonight. I'm just going to leave this comment here for now.

  4. Malcohol commented on Aug 6, 2019

    @Malcohol
    Contributor

    The following screenshot shows a node zoomed in the Images sample. Notice that the node background is cut off in the top right and bottom left corners:

    croppingProblem

    I did a little more investigation into this bug. I continue to believe it is a Qt problem.

    I was able to reproduce it with a trivial set up and it seems to be an interaction between DeviceCoordinateCache and QGraphicsDropShadowEffect: When a QGraphicsItem which is larger than the view widget has a cache type of DeviceCoordinateCache, a drop shadow effect will crop the item to the size of the view widget.

    If you don't use the drop shadow effect, then the problem goes away. A possible workaround for nodeeditor is to stop using a DropShadow effect. This bug is quite visible in my project, so I would regard this as a small cost.

  5. Malcohol commented on Aug 8, 2019

    @Malcohol
    Contributor
  6. paceholder commented on Dec 3, 2022

    @paceholder
    Owner

    I was thinking that I am too slow in addressing the issues. But Qt is not much faster.

  7. Daguerreo commented on Dec 5, 2022

    @Daguerreo

    If someone does not raise the version to a newer one (it's marked 15.2), often the issue get lost in the hyperspace. Already happened with the Qt crew

  8. arabine commented on Feb 14, 2023

    @arabine

    Hi, on Linux I have very bad performances if I zoom. By commenting the drop shadow effect, the performance issue is gone, everything is smooth and fluid.

    Please, can you add an option to disable the Drop shadow effect in NodeGraphicsObject? These are the lines:

    {
            auto effect = new QGraphicsDropShadowEffect;
            effect->setOffset(4, 4);
            effect->setBlurRadius(20);
            effect->setColor(nodeStyle.ShadowColor);
    
            setGraphicsEffect(effect);
    }
    
  9. yvanblanchard commented on Apr 2, 2024

    @yvanblanchard

    problem is still unfixed by Qt (https://bugreports.qt.io/browse/QTBUG-77400)...

  10. DUDUACM commented on Nov 18, 2024

    @DUDUACM

    Hi, on Linux I have very bad performances if I zoom. By commenting the drop shadow effect, the performance issue is gone, everything is smooth and fluid.

    Please, can you add an option to disable the Drop shadow effect in NodeGraphicsObject? These are the lines:

    {
            auto effect = new QGraphicsDropShadowEffect;
            effect->setOffset(4, 4);
            effect->setBlurRadius(20);
            effect->setColor(nodeStyle.ShadowColor);
    
            setGraphicsEffect(effect);
    }
    

    When this paragraph was commented out, everything was fine.

  11. lonnie-souder-ii commented on Jul 24, 2025

    @lonnie-souder-ii
    Collaborator

    Workaround has been merged to master here: b56a7d0

    Example code:

    QVariant Graph::nodeData(NodeId nodeId, NodeRole role) const
    {
        switch (role)
        {
            case NodeRole::Style:
            {
                auto style = StyleCollection::nodeStyle();
                style.ShadowEnabled = false; // <-- Here's the workaround
                return style.toJson().toVariantMap();
            }
        }
        return QVariant();
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions