lullaby/tests/layout_system_test.cc
// Test that LayoutSystem does not update ignored elements.
Test that LayoutSystem does not update ignored elements.
Test that LayoutSystem does not update ignored elements .
TEST_F(LayoutSystemTest, CreateLayout_SetElementIgnored) {
  const int num_children = 3;
  const Entity parent = CreateParent();
  Entity children[num_children];
  for (int i = 0; i < num_children; ++i) {
    children[i] = CreateChild(parent);
  }
  const mathfu::vec2 moved_expectations[] = {
      mathfu::vec2(2.3f, 4.5f), mathfu::vec2(2.3f, 4.5f),
      mathfu::vec2(2.3f, 4.5f)
  };
  const mathfu::vec2 ignored_expectations[] = {
      mathfu::vec2(2.3f, 4.5f), mathfu::vec2(-1.f, 1.f), mathfu::vec2(-1.f, 1.f)
  };
  for (int i = 0; i < num_children; ++i) {
    transform_system_->SetLocalTranslation(children[i],
                                           mathfu::vec3(2.3f, 4.5f, 0.f));
  }
  AssertTranslationsAndSizes(num_children, children, moved_expectations);
  layout_system_->SetElementIgnored(children[0], true);
  AssertTranslationsAndSizes(num_children, children, ignored_expectations);
}
TEST_F ( LayoutSystemTest , CreateLayout_SetElementIgnored ) { const int num_children = 3 ; const Entity parent = CreateParent ( ) ; Entity children [ num_children ] ; for ( int i = 0 ; i < num_children ; ++ i ) { children [ i ] = CreateChild ( parent ) ; } const mathfu :: vec2 moved_expectations [ ] = { mathfu :: vec2 ( 2.3f , 4.5f ) , mathfu :: vec2 ( 2.3f , 4.5f ) , mathfu :: vec2 ( 2.3f , 4.5f ) } ; const mathfu :: vec2 ignored_expectations [ ] = { mathfu :: vec2 ( 2.3f , 4.5f ) , mathfu :: vec2 ( -1.f , 1.f ) , mathfu :: vec2 ( -1.f , 1.f ) } ; for ( int i = 0 ; i < num_children ; ++ i ) { transform_system_ -> SetLocalTranslation ( children [ i ] , mathfu :: vec3 ( 2.3f , 4.5f , 0.f ) ) ; } AssertTranslationsAndSizes ( num_children , children , moved_expectations ) ; layout_system_ -> SetElementIgnored ( children [ 0 ] , true ) ; AssertTranslationsAndSizes ( num_children , children , ignored_expectations ) ; }
Test that LayoutSystem does not update ignored elements.
Test that LayoutSystem does not update ignored elements .