spacr.qt.widgets.cursor_zoom

Explicit cursor anchoring for image views, independent of Qt mouse history.

Functions

zoom_at_pointer(view, factor[, position])

Scale an image while retaining the scene point beneath a viewport point.

Module Contents

spacr.qt.widgets.cursor_zoom.zoom_at_pointer(view, factor, position=None)[source]

Scale an image while retaining the scene point beneath a viewport point.

Parameters:
  • view – QGraphicsView whose owner suppresses peer updates while zooming.

  • factor – positive, finite magnification multiplier.

  • position – viewport coordinates; None uses its center for buttons.

Returns:

whether a zoom was applied. Extra scene margins allow anchoring even when the image is smaller than the viewport. The scene itself remains unchanged so fit-to-image still uses the actual image bounds.