Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Add KisAlgebra2D::createRectFromCorners for line

Agata Cacko9337d98af669
diff --git a/libs/global/kis_algebra_2d.h b/libs/global/kis_algebra_2d.h
index 327f27faa1..76c16d07fc 100644
--- a/libs/global/kis_algebra_2d.h
+++ b/libs/global/kis_algebra_2d.h
@@ -318,6 +318,15 @@ createRectFromCorners(Point corner1, Point corner2)
return typename PointTypeTraits<Point>::rect_type(qMin(corner1.x(), corner2.x()), qMin(corner1.y(), corner2.y()), qAbs(corner1.x() - corner2.x()), qAbs(corner1.y() - corner2.y()));
}
+inline QRectF createRectFromCorners(QLineF line)
+{
+ QPointF a = line.p1();
+ QPointF b = line.p2();
+ return createRectFromCorners(a, b);
+}
+
+
+
template <class Size>
auto maxDimension(Size size) -> decltype(size.width()) {
return qMax(size.width(), size.height());