forked from jan/fatamorgana
Update modal coordinates even if we are in relative mode
This commit is contained in:
parent
86c1e4cd3b
commit
94555c1b6e
@ -2575,16 +2575,14 @@ def adjust_coordinates(record, modals: Modals, mx_field: str, my_field: str):
|
|||||||
if record.x is not None:
|
if record.x is not None:
|
||||||
if modals.xy_relative:
|
if modals.xy_relative:
|
||||||
record.x += getattr(modals, mx_field)
|
record.x += getattr(modals, mx_field)
|
||||||
else:
|
setattr(modals, mx_field, record.x)
|
||||||
setattr(modals, mx_field, record.x)
|
|
||||||
else:
|
else:
|
||||||
record.x = getattr(modals, mx_field)
|
record.x = getattr(modals, mx_field)
|
||||||
|
|
||||||
if record.y is not None:
|
if record.y is not None:
|
||||||
if modals.xy_relative:
|
if modals.xy_relative:
|
||||||
record.y += getattr(modals, my_field)
|
record.y += getattr(modals, my_field)
|
||||||
else:
|
setattr(modals, my_field, record.y)
|
||||||
setattr(modals, my_field, record.y)
|
|
||||||
else:
|
else:
|
||||||
record.y = getattr(modals, my_field)
|
record.y = getattr(modals, my_field)
|
||||||
|
|
||||||
@ -2672,6 +2670,7 @@ def dedup_coordinates(record, modals: Modals, mx_field: str, my_field: str):
|
|||||||
mx = getattr(modals, mx_field)
|
mx = getattr(modals, mx_field)
|
||||||
if modals.xy_relative:
|
if modals.xy_relative:
|
||||||
record.x -= mx
|
record.x -= mx
|
||||||
|
setattr(modals, mx_field, record.x)
|
||||||
else:
|
else:
|
||||||
if record.x == mx:
|
if record.x == mx:
|
||||||
record.x = None
|
record.x = None
|
||||||
@ -2682,6 +2681,7 @@ def dedup_coordinates(record, modals: Modals, mx_field: str, my_field: str):
|
|||||||
my = getattr(modals, my_field)
|
my = getattr(modals, my_field)
|
||||||
if modals.xy_relative:
|
if modals.xy_relative:
|
||||||
record.y -= my
|
record.y -= my
|
||||||
|
setattr(modals, my_field, record.y)
|
||||||
else:
|
else:
|
||||||
if record.y == my:
|
if record.y == my:
|
||||||
record.y = None
|
record.y = None
|
||||||
|
Loading…
Reference in New Issue
Block a user