sortPathConstraintAttachmentWith method

void sortPathConstraintAttachmentWith(
  1. Attachment attachment,
  2. Bone slotBone
)

Implementation

void sortPathConstraintAttachmentWith(Attachment attachment, Bone slotBone) {
  if (attachment is! PathAttachment) return;
  final PathAttachment pathAttachment = attachment;
  final Int32List? pathBones = pathAttachment.bones;
  if (pathBones == null) {
    sortBone(slotBone);
  } else {
    final List<Bone> bones = this.bones;
    int i = 0;
    while (i < pathBones.length) {
      final int boneCount = pathBones[i++];
      final int n = i + boneCount;
      for (; i < n; i++) {
        final int boneIndex = pathBones[i];
        sortBone(bones[boneIndex]);
      }
    }
  }
}