Merge branch 'blender-v4.4-release'
This commit is contained in:
@@ -72,10 +72,6 @@
|
||||
|
||||
using blender::Vector;
|
||||
|
||||
/* Pixel distance from 0% to 100%. */
|
||||
#define SLIDE_PIXEL_DISTANCE (300 * U.pixelsize)
|
||||
#define OVERSHOOT_RANGE_DELTA 0.2f
|
||||
|
||||
/* **************************************************** */
|
||||
/* A) Push & Relax, Breakdowner */
|
||||
|
||||
|
||||
@@ -4182,9 +4182,10 @@ static void area_join_update_data(bContext *C, sAreaJoinData *jd, const wmEvent
|
||||
jd->dock_target = area_docking_target(jd, event);
|
||||
|
||||
if (jd->sa1 == area) {
|
||||
const int drag_threshold = 30 * UI_SCALE_FAC;
|
||||
jd->sa2 = area;
|
||||
if (!(abs(jd->start_x - event->xy[0]) > (30 * U.pixelsize) ||
|
||||
abs(jd->start_y - event->xy[1]) > (30 * U.pixelsize)))
|
||||
if (!(abs(jd->start_x - event->xy[0]) > drag_threshold ||
|
||||
abs(jd->start_y - event->xy[1]) > drag_threshold))
|
||||
{
|
||||
/* We haven't moved enough to start a split. */
|
||||
jd->dir = SCREEN_DIR_NONE;
|
||||
|
||||
@@ -959,7 +959,7 @@ float ED_view3d_grid_view_scale(const Scene *scene,
|
||||
|
||||
static void draw_view_axis(RegionView3D *rv3d, const rcti *rect)
|
||||
{
|
||||
const float k = U.rvisize * U.pixelsize; /* axis size */
|
||||
const float k = U.rvisize * UI_SCALE_FAC; /* axis size */
|
||||
/* axis alpha offset (rvibright has range 0-10) */
|
||||
const int bright = -20 * (10 - U.rvibright);
|
||||
|
||||
|
||||
@@ -876,7 +876,12 @@ typedef struct UserDef {
|
||||
|
||||
/** Setting for UI scale (fractional), before screen DPI has been applied. */
|
||||
float ui_scale;
|
||||
/** Setting for UI line width. */
|
||||
/**
|
||||
* Setting for UI line width.
|
||||
*
|
||||
* In most cases this should not be used directly it is an offset used to calculate `pixelsize`
|
||||
* which should be used to define the line width.
|
||||
*/
|
||||
int ui_line_width;
|
||||
/** Runtime, full DPI divided by `pixelsize`. */
|
||||
int dpi;
|
||||
@@ -884,7 +889,18 @@ typedef struct UserDef {
|
||||
float scale_factor;
|
||||
/** Runtime, `1.0 / scale_factor` */
|
||||
float inv_scale_factor;
|
||||
/** Runtime, calculated from line-width and point-size based on DPI (rounded to int). */
|
||||
/**
|
||||
* Runtime, calculated from line-width and point-size based on DPI.
|
||||
*
|
||||
* - Rounded down to an integer, clamped to a minimum of 1.0.
|
||||
* - This includes both the UI scale and windowing system's DPI.
|
||||
* so a HI-DPI display of 200% with a UI scale of 3.0 results in a pixel-size of 6.0
|
||||
* (when the line-width is set to auto).
|
||||
* - The line-width is added to this value, so lines & vertex drawing can be adjusted.
|
||||
*
|
||||
* \note This should never be used as a UI scale value otherwise changing the line-width
|
||||
* could double or halve the size of UI elements. Use #UI_SCALE_FAC instead.
|
||||
*/
|
||||
float pixelsize;
|
||||
/** Deprecated, for forward compatibility. */
|
||||
int virtual_pixel;
|
||||
|
||||
@@ -253,7 +253,7 @@ static void wm_software_cursor_draw_bitmap(const int event_xy[2],
|
||||
|
||||
GPU_matrix_push();
|
||||
|
||||
const int scale = int(U.pixelsize);
|
||||
const int scale = std::max(1, round_fl_to_int(UI_SCALE_FAC));
|
||||
|
||||
unit_m4(gl_matrix);
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ static void wm_gesture_draw_line_active_side(const rcti *rect, const bool flip)
|
||||
GPU_blend(GPU_BLEND_ALPHA);
|
||||
immBindBuiltinProgram(GPU_SHADER_3D_SMOOTH_COLOR);
|
||||
|
||||
const float gradient_length = 150.0f * U.pixelsize;
|
||||
const float gradient_length = 150.0f * UI_SCALE_FAC;
|
||||
float line_dir[2];
|
||||
float gradient_dir[2];
|
||||
float gradient_point[2][2];
|
||||
|
||||
Reference in New Issue
Block a user