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.
This commit is contained in:
rick@ghostpunch.com 2017-08-14 15:59:21 -04:00
parent 87139f5d82
commit 8d248f5ccd

View file

@ -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;