fix coordinate mapping for cell padding hit-test in grid

This commit is contained in:
pax 2026-04-10 20:23:36 -05:00
parent a1ea2b8727
commit 9c42b4fdd7

View File

@ -571,7 +571,8 @@ class ThumbnailGrid(QScrollArea):
# Empty space: flow layout, viewport, or cell padding (missed pixmap) # Empty space: flow layout, viewport, or cell padding (missed pixmap)
is_empty = child is self.widget() or child is self.viewport() is_empty = child is self.widget() or child is self.viewport()
if not is_empty and isinstance(child, ThumbnailWidget): if not is_empty and isinstance(child, ThumbnailWidget):
local = child.mapFromParent(self.widget().mapFromParent(event.position().toPoint())) global_pos = self.mapToGlobal(event.position().toPoint())
local = child.mapFromGlobal(global_pos)
if not child._hit_pixmap(local): if not child._hit_pixmap(local):
is_empty = True is_empty = True
if is_empty: if is_empty: