3D View: scale edit-mesh drawing by pixel size
authorCampbell Barton <ideasman42@gmail.com>
Thu, 30 Aug 2018 04:28:50 +0000 (14:28 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 30 Aug 2018 04:28:50 +0000 (14:28 +1000)
source/blender/draw/intern/draw_common.c

index 30b1ebe07cd4de8ebdf49f20f044b46713420753..691cd27051a431681506efdcfc1a505b03064c0f 100644 (file)
@@ -119,11 +119,10 @@ void DRW_globals_update(void)
        ts.sizeLampCircleShadow = ts.sizeLampCircle + U.pixelsize * 3.0f;
 
        /* M_SQRT2 to be at least the same size of the old square */
-       ts.sizeVertex = max_ff(1.0f, UI_GetThemeValuef(TH_VERTEX_SIZE) * (float)M_SQRT2 / 2.0f);
-       ts.sizeFaceDot = UI_GetThemeValuef(TH_FACEDOT_SIZE);
-       ts.sizeEdge = 1.0f / 2.0f; /* TODO Theme */
-       ts.sizeEdgeFix = 0.5f + 2.0f * (2.0f * (MAX2(ts.sizeVertex, ts.sizeEdge)) * (float)M_SQRT1_2);
-
+       ts.sizeVertex = U.pixelsize * (max_ff(1.0f, UI_GetThemeValuef(TH_VERTEX_SIZE) * (float)M_SQRT2 / 2.0f));
+       ts.sizeFaceDot = U.pixelsize * UI_GetThemeValuef(TH_FACEDOT_SIZE);
+       ts.sizeEdge = U.pixelsize * (1.0f / 2.0f); /* TODO Theme */
+       ts.sizeEdgeFix = U.pixelsize * (0.5f + 2.0f * (2.0f * (MAX2(ts.sizeVertex, ts.sizeEdge)) * (float)M_SQRT1_2));
 
        if (globals_ubo == NULL) {
                globals_ubo = DRW_uniformbuffer_create(sizeof(GlobalsUboStorage), &ts);