matchStyle method

void matchStyle(
  1. VMobject vmob, {
  2. bool family = true,
})

Implementation

void matchStyle(VMobject vmob, {bool family = true}) {
  setStyleFromVMobjectStyle(vmob.getStyle(), family: false);

  if (family) {
    var submobs1 = submobjects;
    var submobs2 = vmob.submobjects;

    if (submobs1.isEmpty) {
      return;
    } else if (submobs2.isEmpty) {
      submobs2 = [vmob];
    }

    submobs1.removeWhere((element) => element is! VMobject);
    submobs2.removeWhere((element) => element is! VMobject);

    for (var sm12 in IterableZip(
        makeEven(submobs1, submobs2).toList().cast<List<VMobject>>())) {
      sm12[0].matchStyle(sm12[1], family: true);
    }
  }
}