diff --git a/source/blender/editors/sculpt_paint/sculpt.cc b/source/blender/editors/sculpt_paint/sculpt.cc index 34570ffe625..3075ca5c5aa 100644 --- a/source/blender/editors/sculpt_paint/sculpt.cc +++ b/source/blender/editors/sculpt_paint/sculpt.cc @@ -2957,9 +2957,14 @@ void calc_brush_plane(const Depsgraph &depsgraph, zero_v3(r_area_co); zero_v3(r_area_no); + const bool use_original_plane = (brush.flag & BRUSH_ORIGINAL_PLANE) && + brush.sculpt_brush_type != SCULPT_BRUSH_TYPE_PLANE; + const bool use_original_normal = (brush.flag & BRUSH_ORIGINAL_NORMAL) && + brush.sculpt_brush_type != SCULPT_BRUSH_TYPE_PLANE; + if (SCULPT_stroke_is_main_symmetry_pass(*ss.cache) && - (SCULPT_stroke_is_first_brush_step_of_symmetry_pass(*ss.cache) || - !(brush.flag & BRUSH_ORIGINAL_PLANE) || !(brush.flag & BRUSH_ORIGINAL_NORMAL))) + (SCULPT_stroke_is_first_brush_step_of_symmetry_pass(*ss.cache) || !use_original_plane || + !use_original_normal)) { switch (brush.sculpt_plane) { case SCULPT_DISP_DIR_VIEW: @@ -2994,9 +2999,7 @@ void calc_brush_plane(const Depsgraph &depsgraph, } /* For area normal. */ - if (!SCULPT_stroke_is_first_brush_step_of_symmetry_pass(*ss.cache) && - (brush.flag & BRUSH_ORIGINAL_NORMAL)) - { + if (!SCULPT_stroke_is_first_brush_step_of_symmetry_pass(*ss.cache) && use_original_normal) { copy_v3_v3(r_area_no, ss.cache->sculpt_normal); } else { @@ -3004,9 +3007,7 @@ void calc_brush_plane(const Depsgraph &depsgraph, } /* For flatten center. */ - if (!SCULPT_stroke_is_first_brush_step_of_symmetry_pass(*ss.cache) && - (brush.flag & BRUSH_ORIGINAL_PLANE)) - { + if (!SCULPT_stroke_is_first_brush_step_of_symmetry_pass(*ss.cache) && use_original_plane) { copy_v3_v3(r_area_co, ss.cache->last_center); } else { diff --git a/source/blender/editors/space_node/node_edit.cc b/source/blender/editors/space_node/node_edit.cc index 683b180e2a4..533ea703449 100644 --- a/source/blender/editors/space_node/node_edit.cc +++ b/source/blender/editors/space_node/node_edit.cc @@ -1016,10 +1016,12 @@ wmKeyMap *node_resize_modal_keymap(wmKeyConfig *keyconf) return keymap; } -/* Compute the nearest 1D coordinate corresponding to the nearest grid in node. */ +/* Compute the nearest 1D coordinate corresponding to the nearest grid in node editors. */ static float nearest_node_grid_coord(float co) { - float grid_size = grid_size_get(); + /* Size and location of nodes are independent of UI scale, so grid size should be independent of + * UI scale as well. */ + float grid_size = grid_size_get() / UI_SCALE_FAC; float rest = fmod(co, grid_size); float offset = rest - grid_size / 2 >= 0 ? grid_size : 0;