Fix T48812: Brush size invalid with HIDPI
authorCampbell Barton <ideasman42@gmail.com>
Mon, 11 Jul 2016 15:15:54 +0000 (01:15 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 11 Jul 2016 15:19:07 +0000 (01:19 +1000)
Missed from c5b2f12b

source/blender/editors/sculpt_paint/paint_cursor.c
source/blender/windowmanager/intern/wm_operators.c

index eba9448aa40929536923984628fd1f51ba88c242..53c11e2a6a962ba26dc877a4c7f7cf50c0f499a8 100644 (file)
@@ -1016,7 +1016,7 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
        translation[1] = y;
        outline_alpha = 0.5;
        outline_col = brush->add_col;
-       final_radius = (BKE_brush_size_get(scene, brush) * zoomx) / U.pixelsize;
+       final_radius = (BKE_brush_size_get(scene, brush) * zoomx);
 
        /* don't calculate rake angles while a stroke is active because the rake variables are global and
         * we may get interference with the stroke itself. For line strokes, such interference is visible */
index 4bd1bddb4dced10ee3a8aa8be12c44c8c25425f1..78273615602f8f7bff2ece3bc654c863f098c628 100644 (file)
@@ -2851,8 +2851,8 @@ void WM_OT_straightline_gesture(wmOperatorType *ot)
 
 /* *********************** radial control ****************** */
 
-#define WM_RADIAL_CONTROL_DISPLAY_SIZE (200 * U.pixelsize)
-#define WM_RADIAL_CONTROL_DISPLAY_MIN_SIZE (35 * U.pixelsize)
+#define WM_RADIAL_CONTROL_DISPLAY_SIZE (200)
+#define WM_RADIAL_CONTROL_DISPLAY_MIN_SIZE (35)
 #define WM_RADIAL_CONTROL_DISPLAY_WIDTH (WM_RADIAL_CONTROL_DISPLAY_SIZE - WM_RADIAL_CONTROL_DISPLAY_MIN_SIZE)
 #define WM_RADIAL_MAX_STR 10
 
@@ -2929,7 +2929,7 @@ static void radial_control_set_initial_mouse(RadialControl *rc, const wmEvent *e
                case PROP_NONE:
                case PROP_DISTANCE:
                case PROP_PIXEL:
-                       d[0] = rc->initial_value * U.pixelsize;
+                       d[0] = rc->initial_value;
                        break;
                case PROP_PERCENTAGE:
                        d[0] = (rc->initial_value) / 100.0f * WM_RADIAL_CONTROL_DISPLAY_WIDTH + WM_RADIAL_CONTROL_DISPLAY_MIN_SIZE;
@@ -3055,8 +3055,8 @@ static void radial_control_paint_cursor(bContext *C, int x, int y, void *customd
                case PROP_NONE:
                case PROP_DISTANCE:
                case PROP_PIXEL:
-                       r1 = rc->current_value * U.pixelsize;
-                       r2 = rc->initial_value * U.pixelsize;
+                       r1 = rc->current_value;
+                       r2 = rc->initial_value;
                        tex_radius = r1;
                        alpha = 0.75;
                        break;
@@ -3538,7 +3538,6 @@ 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_PERCENTAGE:
                                                        new_value = ((dist - WM_RADIAL_CONTROL_DISPLAY_MIN_SIZE) / WM_RADIAL_CONTROL_DISPLAY_WIDTH) * 100.0f;