remove debug statement
This commit is contained in:
parent
e52cb7334a
commit
56ea7d5ea9
@ -192,15 +192,11 @@ class MainWindow(
|
|||||||
|
|
||||||
def update_scrollbars(self):
|
def update_scrollbars(self):
|
||||||
"""Update scrollbar positions and ranges based on current content and pan offset"""
|
"""Update scrollbar positions and ranges based on current content and pan offset"""
|
||||||
print(f"UPDATE_SCROLLBARS: START - pan_offset = [{self._gl_widget.pan_offset[0]:.1f}, {self._gl_widget.pan_offset[1]:.1f}]")
|
|
||||||
self._updating_scrollbars = True
|
self._updating_scrollbars = True
|
||||||
|
|
||||||
# Block signals to prevent feedback loop
|
# Block signals to prevent feedback loop
|
||||||
signals_were_blocked_v = self._v_scrollbar.signalsBlocked()
|
|
||||||
signals_were_blocked_h = self._h_scrollbar.signalsBlocked()
|
|
||||||
self._v_scrollbar.blockSignals(True)
|
self._v_scrollbar.blockSignals(True)
|
||||||
self._h_scrollbar.blockSignals(True)
|
self._h_scrollbar.blockSignals(True)
|
||||||
print(f"UPDATE_SCROLLBARS: Blocked signals (v was {signals_were_blocked_v}, h was {signals_were_blocked_h})")
|
|
||||||
|
|
||||||
# Get content bounds
|
# Get content bounds
|
||||||
bounds = self._gl_widget.get_content_bounds()
|
bounds = self._gl_widget.get_content_bounds()
|
||||||
@ -210,20 +206,16 @@ class MainWindow(
|
|||||||
content_height = bounds['height']
|
content_height = bounds['height']
|
||||||
content_width = bounds['width']
|
content_width = bounds['width']
|
||||||
|
|
||||||
print(f"UPDATE_SCROLLBARS: content={content_width:.0f}x{content_height:.0f}, viewport={viewport_width}x{viewport_height}")
|
|
||||||
|
|
||||||
# Vertical scrollbar
|
# Vertical scrollbar
|
||||||
# Scrollbar value 0 = top of content
|
# Scrollbar value 0 = top of content
|
||||||
# Scrollbar value max = bottom of content
|
# Scrollbar value max = bottom of content
|
||||||
# Pan offset is inverted: positive pan = content moved down = view at top
|
# Pan offset is inverted: positive pan = content moved down = view at top
|
||||||
# negative pan = content moved up = view at bottom
|
# negative pan = content moved up = view at bottom
|
||||||
v_range = int(max(0, content_height - viewport_height))
|
v_range = int(max(0, content_height - viewport_height))
|
||||||
v_value = int(max(0, min(v_range, -self._gl_widget.pan_offset[1])))
|
|
||||||
print(f"UPDATE_SCROLLBARS: Setting v_scrollbar range=0-{v_range}, value={v_value} (from pan_y={self._gl_widget.pan_offset[1]:.1f})")
|
|
||||||
self._v_scrollbar.setRange(0, v_range)
|
self._v_scrollbar.setRange(0, v_range)
|
||||||
self._v_scrollbar.setPageStep(int(viewport_height))
|
self._v_scrollbar.setPageStep(int(viewport_height))
|
||||||
# Invert pan_offset for scrollbar position
|
# Invert pan_offset for scrollbar position
|
||||||
self._v_scrollbar.setValue(v_value)
|
self._v_scrollbar.setValue(int(max(0, min(v_range, -self._gl_widget.pan_offset[1]))))
|
||||||
|
|
||||||
# Show/hide vertical scrollbar based on whether scrolling is needed
|
# Show/hide vertical scrollbar based on whether scrolling is needed
|
||||||
# Set flag to prevent resizeGL from recentering when scrollbar visibility changes
|
# Set flag to prevent resizeGL from recentering when scrollbar visibility changes
|
||||||
@ -244,10 +236,8 @@ class MainWindow(
|
|||||||
# Unblock signals
|
# Unblock signals
|
||||||
self._v_scrollbar.blockSignals(False)
|
self._v_scrollbar.blockSignals(False)
|
||||||
self._h_scrollbar.blockSignals(False)
|
self._h_scrollbar.blockSignals(False)
|
||||||
print(f"UPDATE_SCROLLBARS: Unblocked signals")
|
|
||||||
|
|
||||||
self._updating_scrollbars = False
|
self._updating_scrollbars = False
|
||||||
print(f"UPDATE_SCROLLBARS: END - pan_offset = [{self._gl_widget.pan_offset[0]:.1f}, {self._gl_widget.pan_offset[1]:.1f}]")
|
|
||||||
|
|
||||||
def _register_shortcuts(self):
|
def _register_shortcuts(self):
|
||||||
"""Register keyboard shortcuts from decorated methods"""
|
"""Register keyboard shortcuts from decorated methods"""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user