Cleanup: Overlay-Next: Use same test for V3D everywhere

This commit is contained in:
Clément Foucault
2024-11-18 15:54:45 +01:00
parent fb6188f658
commit 376f896b1f
5 changed files with 6 additions and 5 deletions

View File

@@ -133,7 +133,7 @@ class Armatures {
void begin_sync(Resources &res, const State &state)
{
enabled_ = state.v3d && !(state.overlay.flag & V3D_OVERLAY_HIDE_BONES);
enabled_ = state.space_type == SPACE_VIEW3D && !(state.overlay.flag & V3D_OVERLAY_HIDE_BONES);
if (!enabled_) {
return;

View File

@@ -34,7 +34,7 @@ class EditText {
void begin_sync(const State &state)
{
enabled_ = state.v3d;
enabled_ = state.space_type == SPACE_VIEW3D;
text_selection_buf.clear();
text_cursor_buf.clear();
box_line_buf_.clear();

View File

@@ -35,7 +35,8 @@ class Fade {
{
const bool do_edit_mesh_fade_geom = !state.xray_enabled &&
(state.overlay.flag & V3D_OVERLAY_FADE_INACTIVE);
enabled_ = state.v3d && (do_edit_mesh_fade_geom || state.do_pose_fade_geom) &&
enabled_ = state.space_type == SPACE_VIEW3D &&
(do_edit_mesh_fade_geom || state.do_pose_fade_geom) &&
(selection_type_ == SelectionType::DISABLED);
if (!enabled_) {

View File

@@ -28,7 +28,7 @@ class ModeTransfer {
public:
void begin_sync(Resources &res, const State &state)
{
enabled_ = state.v3d && (res.selection_type == SelectionType::DISABLED);
enabled_ = state.space_type == SPACE_VIEW3D && (res.selection_type == SelectionType::DISABLED);
if (!enabled_) {
/* Not used. But release the data. */

View File

@@ -25,7 +25,7 @@ class Origins {
const bool is_paint_mode = (state.object_mode &
(OB_MODE_ALL_PAINT | OB_MODE_ALL_PAINT_GPENCIL |
OB_MODE_SCULPT_CURVES)) != 0;
enabled_ = state.v3d && !is_paint_mode &&
enabled_ = state.space_type == SPACE_VIEW3D && !is_paint_mode &&
(state.overlay.flag & V3D_OVERLAY_HIDE_OBJECT_ORIGINS) == 0;
point_buf_.clear();
}