From 8d248f5ccd2763859c8964847db37cdcbc567bf1 Mon Sep 17 00:00:00 2001 From: "rick@ghostpunch.com" Date: Mon, 14 Aug 2017 15:59:21 -0400 Subject: [PATCH] Remove the attempt to determine the maximum width of a PolyLineEntity's strokes using the _strokeWidths[] array, as the values don't seem to correspond with reality. Use a flat 0.075M value for the maxium half of a stroke width instead. --- libraries/entities/src/PolyLineEntityItem.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/libraries/entities/src/PolyLineEntityItem.cpp b/libraries/entities/src/PolyLineEntityItem.cpp index 4d27330b3e..aa31130c82 100644 --- a/libraries/entities/src/PolyLineEntityItem.cpp +++ b/libraries/entities/src/PolyLineEntityItem.cpp @@ -182,17 +182,9 @@ void PolyLineEntityItem::calculateScaleAndRegistrationPoint() { EntityItem::setRegistrationPoint(glm::vec3(0.5f)); return; } - - // Find the max width of the strokes so we can account for that in the size of the bounding box - float maxWidth = 0.0f; - for (int i = 0; i < _strokeWidths.size(); ++i) { - if (_strokeWidths.at(i) > maxWidth) { - maxWidth = _strokeWidths.at(i); - } - } glm::vec3 result; - float halfLineWidth = (maxWidth > 0.0f) ? maxWidth * 0.5f : 0.0f; + const float halfLineWidth = 0.075f; // sadly _strokeWidths() don't seem to correspond to reality, so just use a flat assumption of the stroke width result.x = fabsf(high.x) + fabsf(low.x) + halfLineWidth; result.y = fabsf(high.y) + fabsf(low.y) + halfLineWidth; result.z = fabsf(high.z) + fabsf(low.z) + halfLineWidth;