# HG changeset patch # User Teemu Piippo # Date 1627373492 -10800 # Node ID ed884a2fb009a628692be39ebfeae5e435a6b939 # Parent 4e03b0e2a29f8601d152c7d307b3f2eeb9f9b343 fix too long lines diff -r 4e03b0e2a29f -r ed884a2fb009 src/geometry.cpp --- a/src/geometry.cpp Tue Jul 27 09:56:06 2021 +0300 +++ b/src/geometry.cpp Tue Jul 27 11:11:32 2021 +0300 @@ -103,7 +103,9 @@ std::optional geom::rayLineSegmentIntersection(const Ray<2>& ray, const LineSegment2D& line) { - std::optional result = lineLineIntersection(rayToLine(ray), lineFromPoints(line.points[0], line.points[1])); + std::optional result = lineLineIntersection( + rayToLine(ray), + lineFromPoints(line.points[0], line.points[1])); if (result.has_value()) { const float d1 = glm::dot(*result - ray.anchor, ray.direction); diff -r 4e03b0e2a29f -r ed884a2fb009 src/geometry.h --- a/src/geometry.h Tue Jul 27 09:56:06 2021 +0300 +++ b/src/geometry.h Tue Jul 27 11:11:32 2021 +0300 @@ -85,7 +85,9 @@ std::optional rayRectangleIntersection(const Ray<2>& ray, const QRectF& rectangle); Plane planeFromTriangle(const Triangle& triangle); glm::vec3 normalVector(const Triangle& triangle); - std::optional linePlaneIntersection(const Line<3>& line, const Plane& plane, const float epsilon = 1e-6f); + std::optional linePlaneIntersection( + const Line<3>& line, + const Plane& plane, const float epsilon = 1e-6f); glm::vec3 scalingVector(const glm::mat4 matrix); LineSegment2D top(const QRectF& rectangle); LineSegment2D bottom(const QRectF& rectangle); diff -r 4e03b0e2a29f -r ed884a2fb009 src/gl/common.h --- a/src/gl/common.h Tue Jul 27 09:56:06 2021 +0300 +++ b/src/gl/common.h Tue Jul 27 11:11:32 2021 +0300 @@ -169,7 +169,12 @@ ConditionalLines }; - constexpr ArrayClass ARRAY_CLASSES[] = {ArrayClass::Lines, ArrayClass::Triangles, ArrayClass::Quads, ArrayClass::ConditionalLines}; + constexpr ArrayClass ARRAY_CLASSES[] = { + ArrayClass::Lines, + ArrayClass::Triangles, + ArrayClass::Quads, + ArrayClass::ConditionalLines, + }; constexpr int NUM_ARRAY_CLASSES = countof(ARRAY_CLASSES); // Different ways to render the scene diff -r 4e03b0e2a29f -r ed884a2fb009 src/gl/compiler.cpp --- a/src/gl/compiler.cpp Tue Jul 27 09:56:06 2021 +0300 +++ b/src/gl/compiler.cpp Tue Jul 27 11:11:32 2021 +0300 @@ -142,7 +142,9 @@ { log += "\n" + QObject::tr("Vertex shader:") + "\n" + shaderProgram->log(); } - const bool fragmentShaderCompiled = shaderProgram->addShaderFromSourceCode(QOpenGLShader::Fragment, fragmentShaderSource); + const bool fragmentShaderCompiled = shaderProgram->addShaderFromSourceCode( + QOpenGLShader::Fragment, + fragmentShaderSource); if (not fragmentShaderCompiled) { log += "\n" + QObject::tr("Fragment shader:") + "\n" + shaderProgram->log(); diff -r 4e03b0e2a29f -r ed884a2fb009 src/parser.cpp --- a/src/parser.cpp Tue Jul 27 09:56:06 2021 +0300 +++ b/src/parser.cpp Tue Jul 27 11:11:32 2021 +0300 @@ -311,7 +311,10 @@ return {x, y, z}; } -static glm::mat4 matrixFromStrings(const QStringList& tokens, const int startingPosition, const int positionStartingIndex) +static glm::mat4 matrixFromStrings( + const QStringList& tokens, + const int startingPosition, + const int positionStartingIndex) { glm::mat4 result = glm::mat4{1}; for (int i = 0; i < 9; i += 1) diff -r 4e03b0e2a29f -r ed884a2fb009 src/ring.h --- a/src/ring.h Tue Jul 27 09:56:06 2021 +0300 +++ b/src/ring.h Tue Jul 27 11:11:32 2021 +0300 @@ -34,8 +34,8 @@ } /* - * Implements a ring adapter over T. This class corrects indices given to the element-operator so that they're within bounds. - * The maximum amount can be specified manually. + * Implements a ring adapter over T. This class corrects indices given to the element-operator so that they're within + * bounds. The maximum amount can be specified manually. * * Example: * @@ -83,8 +83,8 @@ }; /* - * Convenience function for RingAdapter so that the template parameter does not have to be provided. The ring amount is assumed - * to be the amount of elements in the collection. + * Convenience function for RingAdapter so that the template parameter does not have to be provided. The ring + * amount is assumed to be the amount of elements in the collection. */ template iter::_imp::RingAdapter iter::ring(T&& collection) diff -r 4e03b0e2a29f -r ed884a2fb009 src/ui/canvas.cpp --- a/src/ui/canvas.cpp Tue Jul 27 09:56:06 2021 +0300 +++ b/src/ui/canvas.cpp Tue Jul 27 11:11:32 2021 +0300 @@ -213,7 +213,9 @@ for (const auto& axis : directions) { const QPointF x_p = this->modelToScreenCoordinates(axis.direction); - const auto intersection = geom::rayRectangleIntersection(geom::rayFromPoints(toVec2(p1), toVec2(x_p)), box); + const auto intersection = geom::rayRectangleIntersection( + geom::rayFromPoints(toVec2(p1), toVec2(x_p)), + box); if (intersection.has_value()) { renderText(axis.text, *intersection); diff -r 4e03b0e2a29f -r ed884a2fb009 src/ui/multiplyfactordialog.cpp --- a/src/ui/multiplyfactordialog.cpp Tue Jul 27 09:56:06 2021 +0300 +++ b/src/ui/multiplyfactordialog.cpp Tue Jul 27 11:11:32 2021 +0300 @@ -11,8 +11,16 @@ this->preview.setEnabled(false); this->ui->previewGroupBox->setLayout(new QVBoxLayout{parent}); this->ui->previewGroupBox->layout()->addWidget(&this->preview); - connect(this->ui->invert, &QCheckBox::clicked, this, &MultiplyFactorDialog::updatePreview); - connect(this->ui->factor, qOverload(&DoubleSpinBox::valueChanged), this, &MultiplyFactorDialog::updatePreview); + connect( + this->ui->invert, + &QCheckBox::clicked, + this, + &MultiplyFactorDialog::updatePreview); + connect( + this->ui->factor, + qOverload(&DoubleSpinBox::valueChanged), + this, + &MultiplyFactorDialog::updatePreview); } /** diff -r 4e03b0e2a29f -r ed884a2fb009 src/widgets/colorselectdialog.cpp --- a/src/widgets/colorselectdialog.cpp Tue Jul 27 09:56:06 2021 +0300 +++ b/src/widgets/colorselectdialog.cpp Tue Jul 27 11:11:32 2021 +0300 @@ -104,7 +104,8 @@ const ldraw::ColorTable::ColorDefinition& colordef = this->colorTable[this->selectedColor]; this->ui.selectedColorName->setText(colordef.displayName); } - this->ui.selectedColorName->setStyleSheet(styleSheetForColor(ldraw::colorFace(this->selectedColor, this->colorTable))); + const QColor colorFace = ldraw::colorFace(this->selectedColor, this->colorTable); + this->ui.selectedColorName->setStyleSheet(styleSheetForColor(colorFace)); this->ui.colorIndex->setValue(this->selectedColor.index); for (QPushButton* button : this->buttons) {