Fix incorrect pixelsize use where DPI scale was intended

Changing line-width shouldn't scale cursor motion. Related to T79787.

Use dpi_fac for scaling curve error threshold & number button drag
threshold calculation.
This commit is contained in:
Campbell Barton 2020-08-18 11:53:53 +10:00
parent 6978635622
commit d1057890c4
Notes: blender-bot 2024-05-08 11:36:44 +02:00
Referenced by issue #79787, The sensitivity of 3D view navigation depends on Line Width preference
2 changed files with 3 additions and 3 deletions

View File

@ -666,7 +666,7 @@ static void curve_draw_exec_precalc(wmOperator *op)
selem_prev = selem;
}
scale_px = ((len_3d > 0.0f) && (len_2d > 0.0f)) ? (len_3d / len_2d) : 0.0f;
float error_threshold = (cps->error_threshold * U.pixelsize) * scale_px;
float error_threshold = (cps->error_threshold * U.dpi_fac) * scale_px;
RNA_property_float_set(op->ptr, prop, error_threshold);
}
@ -685,7 +685,7 @@ static void curve_draw_exec_precalc(wmOperator *op)
}
if (len_squared_v2v2(selem_first->mval, selem_last->mval) <=
square_f(STROKE_CYCLIC_DIST_PX * U.pixelsize)) {
square_f(STROKE_CYCLIC_DIST_PX * U.dpi_fac)) {
use_cyclic = true;
}
}

View File

@ -4790,7 +4790,7 @@ static bool ui_numedit_but_NUM(uiBut *but,
if (is_float == false) {
/* at minimum, moving cursor 2 pixels should change an int button. */
CLAMP_MIN(non_linear_scale, 0.5f * U.pixelsize);
CLAMP_MIN(non_linear_scale, 0.5f * UI_DPI_FAC);
}
data->dragf += (((float)(mx - data->draglastx)) / deler) * non_linear_scale;