diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2015-02-05 21:15:24 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2015-02-05 21:15:24 +0300 |
commit | d5b1dfa9c6eef4365db1bc51496c71131a8ffa51 (patch) | |
tree | 71a3f974bb60d3bb75854d533473f08578fec511 /source | |
parent | 77698f601021eb557be38945ed74706a325b1c57 (diff) |
More fixes for high DPI:
* Radial operators were completely wrong
* Dynamic topology detail was also using unscaled number
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 2 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 16 |
2 files changed, 7 insertions, 11 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index dbb29997102..122acf3c941 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -4255,7 +4255,7 @@ static void sculpt_stroke_update_step(bContext *C, struct PaintStroke *UNUSED(st BKE_pbvh_bmesh_detail_size_set(ss->pbvh, (ss->cache->radius / (float)ups->pixel_radius) * - (float)sd->detail_size / 0.4f); + (float)(sd->detail_size * U.pixelsize)/ 0.4f); } if (sculpt_stroke_dynamic_topology(ss, brush)) { diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index aa3788bbc90..69c70a7492d 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -3816,8 +3816,8 @@ void WM_OT_straightline_gesture(wmOperatorType *ot) /* *********************** radial control ****************** */ -#define WM_RADIAL_CONTROL_DISPLAY_SIZE 200 -#define WM_RADIAL_CONTROL_DISPLAY_MIN_SIZE 35 +#define WM_RADIAL_CONTROL_DISPLAY_SIZE (200 * U.pixelsize) +#define WM_RADIAL_CONTROL_DISPLAY_MIN_SIZE (35 * U.pixelsize) #define WM_RADIAL_CONTROL_DISPLAY_WIDTH (WM_RADIAL_CONTROL_DISPLAY_SIZE - WM_RADIAL_CONTROL_DISPLAY_MIN_SIZE) #define WM_RADIAL_CONTROL_HEADER_LENGTH 180 #define WM_RADIAL_MAX_STR 6 @@ -3868,7 +3868,7 @@ static void radial_control_set_initial_mouse(RadialControl *rc, const wmEvent *e case PROP_DISTANCE: case PROP_PERCENTAGE: case PROP_PIXEL: - d[0] = rc->initial_value; + d[0] = rc->initial_value * U.pixelsize; break; case PROP_FACTOR: d[0] = (1 - rc->initial_value) * WM_RADIAL_CONTROL_DISPLAY_WIDTH + WM_RADIAL_CONTROL_DISPLAY_MIN_SIZE; @@ -3977,8 +3977,8 @@ static void radial_control_paint_cursor(bContext *C, int x, int y, void *customd case PROP_DISTANCE: case PROP_PERCENTAGE: case PROP_PIXEL: - r1 = rc->current_value; - r2 = rc->initial_value; + r1 = rc->current_value * U.pixelsize; + r2 = rc->initial_value * U.pixelsize; tex_radius = r1; alpha = 0.75; break; @@ -4003,11 +4003,6 @@ static void radial_control_paint_cursor(bContext *C, int x, int y, void *customd break; } - /* adjust for DPI, like BKE_brush_size_get */ - r1 *= U.pixelsize; - r2 *= U.pixelsize; - tex_radius *= U.pixelsize; - /* Keep cursor in the original place */ x = rc->initial_mouse[0] - ar->winrct.xmin; y = rc->initial_mouse[1] - ar->winrct.ymin; @@ -4425,6 +4420,7 @@ static int radial_control_modal(bContext *C, wmOperator *op, const wmEvent *even case PROP_PIXEL: new_value = dist; if (snap) new_value = ((int)new_value + 5) / 10 * 10; + new_value /= U.pixelsize; break; case PROP_FACTOR: new_value = (WM_RADIAL_CONTROL_DISPLAY_SIZE - dist) / WM_RADIAL_CONTROL_DISPLAY_WIDTH; |