From 8ad77f17cfd5d875f1800724e69d6f2dbe3f4507 Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Tue, 24 Jun 2014 13:15:05 -0400 Subject: [PATCH] cleaned up Expanded logic --- openbr/plugins/meta.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/openbr/plugins/meta.cpp b/openbr/plugins/meta.cpp index a30809f..840efdd 100644 --- a/openbr/plugins/meta.cpp +++ b/openbr/plugins/meta.cpp @@ -32,22 +32,23 @@ static TemplateList Expanded(const TemplateList &templates) { TemplateList expanded; foreach (const Template &t, templates) { + const bool enrollAll = t.file.get("enrollAll"); if (t.isEmpty()) { - if (!t.file.get("enrollAll", false)) + if (!enrollAll) expanded.append(t); continue; } - const bool fte = t.file.get("FTE", false); - QList points = t.file.points(); - QList rects = t.file.rects(); + const bool fte = t.file.get("FTE"); + const QList points = t.file.points(); + const QList rects = t.file.rects(); if (points.size() % t.size() != 0) qFatal("Uneven point count."); if (rects.size() % t.size() != 0) qFatal("Uneven rect count."); const int pointStep = points.size() / t.size(); const int rectStep = rects.size() / t.size(); for (int i=0; i("enrollAll", false)) { + if (!fte || !enrollAll) { expanded.append(Template(t.file, t[i])); expanded.last().file.setRects(rects.mid(i*rectStep, rectStep)); expanded.last().file.setPoints(points.mid(i*pointStep, pointStep)); -- libgit2 0.21.4