Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGermano Cavalcante <germano.costa@ig.com.br>2022-04-13 09:21:34 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2022-04-13 16:56:26 +0300
commit754d05ac7ebb78377bbe6d80068542c43d347974 (patch)
treedddcd3f88083a2e5d57b5e7713055158d033fa0c /mesh_snap_utilities_line/common_utilities.py
parentbffb84a0526ffd203ee3abbe6ad18332cda1eb62 (diff)
Snap Utilities Line: consider UI scaling for drawing and snapping
Better match between monitors with different DPI.
Diffstat (limited to 'mesh_snap_utilities_line/common_utilities.py')
-rw-r--r--mesh_snap_utilities_line/common_utilities.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/mesh_snap_utilities_line/common_utilities.py b/mesh_snap_utilities_line/common_utilities.py
index 447265d8..d992141a 100644
--- a/mesh_snap_utilities_line/common_utilities.py
+++ b/mesh_snap_utilities_line/common_utilities.py
@@ -232,11 +232,11 @@ def snap_utilities(
r_loc = t_loc[0]
elif _snap_cache.edge.v2dperp and\
- abs(_snap_cache.edge.v2dperp[0] - mcursor[0]) < 10 and abs(_snap_cache.edge.v2dperp[1] - mcursor[1]) < 10:
+ abs(_snap_cache.edge.v2dperp[0] - mcursor[0]) < sctx._dist_px and abs(_snap_cache.edge.v2dperp[1] - mcursor[1]) < sctx._dist_px:
r_type = 'PERPENDICULAR'
r_loc = _snap_cache.edge.vperp
- elif abs(_snap_cache.edge.v2dmid[0] - mcursor[0]) < 10 and abs(_snap_cache.edge.v2dmid[1] - mcursor[1]) < 10:
+ elif abs(_snap_cache.edge.v2dmid[0] - mcursor[0]) < sctx._dist_px and abs(_snap_cache.edge.v2dmid[1] - mcursor[1]) < sctx._dist_px:
r_type = 'CENTER'
r_loc = _snap_cache.edge.vmid