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

This commit is contained in:
Brecht Van Lommel 2019-05-19 10:03:45 +02:00
parent f7b60f878b
commit c0352551d2
Notes: blender-bot 2023-12-22 20:14:11 +01:00
Referenced by issue #64822, Blender on retina displays needs UX improvements
1 changed files with 2 additions and 2 deletions

View File

@ -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++) {