diff --git a/ECTrainer2/MovieObject.cpp b/ECTrainer2/MovieObject.cpp index b20cc32..2a1a1da 100644 --- a/ECTrainer2/MovieObject.cpp +++ b/ECTrainer2/MovieObject.cpp @@ -3,7 +3,7 @@ // コンストラクタ MovieObject::MovieObject() - :_lastAccess(0) + :_lastAccess(0), _holdTargetSize(false) { } @@ -16,6 +16,9 @@ for (int r = 0; r < table.size(); r++) { // 行チェック int cols = (int)table[r].size(); + if (r == 0 && cols > 1) { + if (table[r][1] == "hold") _holdTargetSize = true; + } if (cols < 4 || (cols - 1) % 3 != 0) continue; bool check = true; @@ -39,10 +42,13 @@ (float)d)); area += d * d; } - double adj = (area == 0 ? 0 : sqrt(FixedArea / area)); - if (adj > 1.0) { - for (int e = 0; e < nElements; e++) { - fi.elements[e].d *= (float)adj; + // ターゲットサイズの補正(最小面積を担保する) + if (!_holdTargetSize) { + double adj = (area == 0 ? 0 : sqrt(FixedArea / area)); + if (adj > 1.0) { + for (int e = 0; e < nElements; e++) { + fi.elements[e].d *= (float)adj; + } } } _frame.push_back(fi); diff --git a/ECTrainer2/MovieObject.h b/ECTrainer2/MovieObject.h index f7de34c..c2ba7e2 100644 --- a/ECTrainer2/MovieObject.h +++ b/ECTrainer2/MovieObject.h @@ -32,6 +32,7 @@ class MovieObject { std::vector _frame; int _lastAccess; + bool _holdTargetSize; public: // コンストラクタ