# HG changeset patch # User Teemu Piippo # Date 1528488416 -10800 # Node ID 8d9d0532b3df86e17fce60f3b437ad624132a645 # Parent f0fe7ea82b811b6ddf2008d2c73f1e0480fadf04 fixed cylinder rendering diff -r f0fe7ea82b81 -r 8d9d0532b3df src/lddocument.cpp --- a/src/lddocument.cpp Thu Jun 07 23:24:02 2018 +0300 +++ b/src/lddocument.cpp Fri Jun 08 23:06:56 2018 +0300 @@ -531,7 +531,7 @@ { // Got another sub-file reference, recurse and inline it too if we're deep-inlining. // If not, just add it into the objects normally. - if (deep and object->type() == LDObjectType::SubfileReference) + if (deep and object->isRasterizable()) { LDSubfileReference* reference = static_cast(object); reference->rasterize( diff -r f0fe7ea82b81 -r 8d9d0532b3df src/linetypes/cylinder.cpp --- a/src/linetypes/cylinder.cpp Thu Jun 07 23:24:02 2018 +0300 +++ b/src/linetypes/cylinder.cpp Fri Jun 08 23:06:56 2018 +0300 @@ -77,8 +77,9 @@ QVector LDCylinder::rasterizePolygons(DocumentManager* context, Winding winding) { Model cylinderBody {context}; - buildPrimitiveBody(cylinderBody, winding); + buildPrimitiveBody(cylinderBody); QVector result; + bool cachedShouldInvert = shouldInvert(winding, context); for (LDObject* object : cylinderBody.objects()) { @@ -93,7 +94,7 @@ if (polygon) { - if (shouldInvert(winding, context)) + if (cachedShouldInvert) invertPolygon(*polygon); result.append(*polygon); @@ -105,14 +106,14 @@ return result; } -void LDCylinder::buildPrimitiveBody(Model& model, Winding winding) const +void LDCylinder::buildPrimitiveBody(Model& model) const { PrimitiveModel primitive; primitive.type = PrimitiveModel::Cylinder; primitive.segments = m_segments; primitive.divisions = m_divisions; primitive.ringNumber = 0; - primitive.generateCylinder(model, winding); + primitive.generateCylinder(model); } QString LDCylinder::objectListText() const diff -r f0fe7ea82b81 -r 8d9d0532b3df src/linetypes/cylinder.h --- a/src/linetypes/cylinder.h Thu Jun 07 23:24:02 2018 +0300 +++ b/src/linetypes/cylinder.h Fri Jun 08 23:06:56 2018 +0300 @@ -32,7 +32,7 @@ private: QString buildFilename() const; - void buildPrimitiveBody(Model& model, Winding winding = CounterClockwise) const; + void buildPrimitiveBody(Model& model) const; int m_segments; int m_divisions;