[Bf-blender-cvs] [c0352551d2f] master: Fix T64822: curve widget point selection does not take into account DPI

Brecht Van Lommel noreply at git.blender.org
Sun May 19 11:34:21 CEST 2019


Commit: c0352551d2fdd3d192558f04cfb52dc47c05ba88
Author: Brecht Van Lommel
Date:   Sun May 19 10:03:45 2019 +0200
Branches: master
https://developer.blender.org/rBc0352551d2fdd3d192558f04cfb52dc47c05ba88

Fix T64822: curve widget point selection does not take into account DPI

===================================================================

M	source/blender/editors/interface/interface_handlers.c

===================================================================

diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index a3b438ece42..bcd6813128d 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -6530,7 +6530,7 @@ static int ui_do_but_CURVE(
       CurveMap *cuma = cumap->cm + cumap->cur;
       CurveMapPoint *cmp;
       const float m_xy[2] = {mx, my};
-      float dist_min_sq = SQUARE(14.0f); /* 14 pixels radius */
+      float dist_min_sq = SQUARE(U.dpi_fac * 14.0f); /* 14 pixels radius */
       int sel = -1;
 
       if (event->ctrl) {
@@ -6565,7 +6565,7 @@ static int ui_do_but_CURVE(
         BLI_rctf_transform_pt_v(&but->rect, &cumap->curr, f_xy, &cmp[0].x);
 
         /* with 160px height 8px should translate to the old 0.05 coefficient at no zoom */
-        dist_min_sq = SQUARE(8.0f);
+        dist_min_sq = SQUARE(U.dpi_fac * 8.0f);
 
         /* loop through the curve segment table and find what's near the mouse. */
         for (i = 1; i <= CM_TABLE; i++) {



More information about the Bf-blender-cvs mailing list