mirror of
https://github.com/ralsina/xrandroll.git
synced 2024-11-24 20:12:21 +00:00
Fix snapping
This commit is contained in:
parent
a679343b16
commit
183c2f1817
@ -76,8 +76,8 @@ class MonitorItem(QGraphicsRectItem, QObject):
|
|||||||
current_pos = event.screenPos()
|
current_pos = event.screenPos()
|
||||||
new_pos = view.mapFromScene(self.orig_pos) + current_pos - click_pos
|
new_pos = view.mapFromScene(self.orig_pos) + current_pos - click_pos
|
||||||
new_pos = view.mapToScene(new_pos)
|
new_pos = view.mapToScene(new_pos)
|
||||||
delta = view.mapToScene(0, 20).y()
|
delta = abs(view.mapToScene(0, 25).y())
|
||||||
if not event.modifiers() & Qt.AltModifier:
|
if not event.modifiers() & Qt.ControlModifier:
|
||||||
# Check for snaps
|
# Check for snaps
|
||||||
x = new_pos.x()
|
x = new_pos.x()
|
||||||
delta_x = min((abs(x - sx), i) for i, sx in enumerate(snaps_x))
|
delta_x = min((abs(x - sx), i) for i, sx in enumerate(snaps_x))
|
||||||
|
Loading…
Reference in New Issue
Block a user