Fix rotate around point under cursor 'seeing' hidden faces in paint modes.
[blender.git] / source / blender / draw / engines / basic / basic_engine.c
index 9dc8c8f2f34619884f402dce16bbd02d068a3bcd..8356838a885cb90b21f34849d03c759d9d0a60e9 100644 (file)
@@ -157,7 +157,10 @@ static void basic_cache_populate(void *vedata, Object *ob)
                }
        }
 
-       struct GPUBatch *geom = DRW_cache_object_surface_get(ob);
+       const bool is_active = (ob == draw_ctx->obact);
+       const bool use_hide = is_active && DRW_object_use_hide_faces(ob);
+
+       struct GPUBatch *geom = DRW_cache_object_surface_get_ex(ob, use_hide);
        if (geom) {
                const bool do_cull = (draw_ctx->v3d && (draw_ctx->v3d->flag2 & V3D_BACKFACE_CULLING));
                /* Depth Prepass */