You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a widget has been hidden using hide_widget, it will reappear after the viewer is zoom-out (very small) and zoom-in.
File: node_base.py
def set_proxy_mode(self, mode):
"""
Set whether to draw the node with proxy mode.
(proxy mode toggles visibility for some qgraphic items in the node.)
Args:
mode (bool): true to enable proxy mode.
"""
...
# node widget visibility. =>need to add some conditions<=
for w in self._widgets.values():
w.widget().setVisible(visible)
The text was updated successfully, but these errors were encountered:
hmq2018
changed the title
If a widget has been hidden using hide_widget, it will reappear after the view is zoom-in and zoom-out
If a widget has been hidden using hide_widget, it will reappear after the view is zoom-out and zoom-in
Mar 5, 2024
Just in case anyone needs, if you don't need proxy mode and want to disable this behaviour, you can just edit the "auto_switch_mode" method in "node_base.py" to:
def auto_switch_mode(self):
"""
Decide whether to draw the node with proxy mode.
(this is called at the start in the "self.paint()" function.)
"""
if ITEM_CACHE_MODE is QtWidgets.QGraphicsItem.ItemCoordinateCache:
return
rect = self.sceneBoundingRect()
l = self.viewer().mapToGlobal(
self.viewer().mapFromScene(rect.topLeft()))
r = self.viewer().mapToGlobal(
self.viewer().mapFromScene(rect.topRight()))
# width is the node width in screen
width = r.x() - l.x()
#self.set_proxy_mode(width < self._proxy_mode_threshold)
# TODO: maybe limit zoom instead?
self.set_proxy_mode(False)
If a widget has been hidden using hide_widget, it will reappear after the viewer is zoom-out (very small) and zoom-in.
File: node_base.py
The text was updated successfully, but these errors were encountered: