diff --git a/CMakeLists.txt b/CMakeLists.txt index 453695c0c2ae..a2c02f4146ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -144,21 +144,23 @@ endif() find_package(ZLIB REQUIRED) find_package(Threads REQUIRED) - +set(CMAKE_FIND_DEBUG_MODE TRUE) option(ENABLE_PLUGINS "Compile with plugin support" ON) -find_package(Lua) # Lua 5.4 is only supported with cmake >=3.18 +find_package(Lua REQUIRED) # Lua 5.4 is only supported with cmake >=3.18 +set(CMAKE_FIND_DEBUG_MODE FALSE) message(STATUS "Found Lua: ${Lua_FOUND}") -if (Lua_FOUND AND ENABLE_PLUGINS) +#if (Lua_FOUND AND ENABLE_PLUGINS) # currently not fully supported by cmake message(STATUS "Enable Xournal++ Plugins") - add_library(lua INTERFACE) - target_link_libraries(lua INTERFACE ${LUA_LIBRARIES}) - target_include_directories(lua INTERFACE ${LUA_INCLUDE_DIR}) - add_library(Lua::lua ALIAS lua) -else () - message(STATUS "Disable Xournal++ Plugins") - set(ENABLE_PLUGINS OFF) -endif () + add_library(lua-if INTERFACE) + target_link_libraries(lua-if INTERFACE ${LUA_LIBRARIES}) + target_include_directories(lua-if INTERFACE ${LUA_INCLUDE_DIR}) + target_compile_definitions(lua-if INTERFACE ENABLE_PLUGINS) + add_library(Lua::lua ALIAS lua-if) +#else () +# message(STATUS "Disable Xournal++ Plugins") +# set(ENABLE_PLUGINS OFF) +#endif () if (GtkSourceView_FOUND) message("Enable GtkSourceView TeX syntax highlighting") diff --git a/src/core/control/CompassController.cpp b/src/core/control/CompassController.cpp index c996b9b6bc13..84a5fd175754 100644 --- a/src/core/control/CompassController.cpp +++ b/src/core/control/CompassController.cpp @@ -80,7 +80,8 @@ void CompassController::updateOutlineStroke(double x) { stroke->deletePointsFrom(0); const auto h = view->getXournal()->getControl()->getToolHandler(); const bool filled = (h->getFill() != -1); - const xoj::util::Point c = xoj::util::Point{geometryTool->getTranslationX(), geometryTool->getTranslationY()}; + const xoj::util::Point c = + xoj::util::Point{geometryTool->getTranslationX(), geometryTool->getTranslationY()}; if (filled && angleMax < angleMin + 2 * M_PI) { stroke->addPoint(Point(c.x, c.y)); diff --git a/src/core/control/LatexController.cpp b/src/core/control/LatexController.cpp index 1e2a2ec24b6b..b8d26d784761 100644 --- a/src/core/control/LatexController.cpp +++ b/src/core/control/LatexController.cpp @@ -310,7 +310,7 @@ auto LatexController::loadRendered(string renderedTex) -> std::unique_ptrsetText(std::move(renderedTex)); img->setX(posx); img->setY(posy); - + if (imgheight > 1024 * std::numeric_limits::epsilon()) { double ratio = img->getElementWidth() / img->getElementHeight(); img->scale({posx, posy}, ratio, ratio, true); diff --git a/src/core/control/SetsquareController.cpp b/src/core/control/SetsquareController.cpp index 75fead20b4d1..3aba74262563 100644 --- a/src/core/control/SetsquareController.cpp +++ b/src/core/control/SetsquareController.cpp @@ -24,9 +24,11 @@ auto SetsquareController::posRelToSide(Leg leg, double x, double y) const -> xoj case HYPOTENUSE: return xoj::util::Point(x, -y); case LEFT_LEG: - return xoj::util::Point((y + x) / std::sqrt(2.), (y - x - geometryTool->getHeight()) / std::sqrt(2.)); + return xoj::util::Point((y + x) / std::sqrt(2.), + (y - x - geometryTool->getHeight()) / std::sqrt(2.)); case RIGHT_LEG: - return xoj::util::Point((y - x) / std::sqrt(2.), (y + x - geometryTool->getHeight()) / std::sqrt(2.)); + return xoj::util::Point((y - x) / std::sqrt(2.), + (y + x - geometryTool->getHeight()) / std::sqrt(2.)); default: g_error("Invalid enum value: %d", leg); } diff --git a/src/core/control/latex/LatexGenerator.cpp b/src/core/control/latex/LatexGenerator.cpp index 89c22f7cdf24..0c3e67a8c79b 100644 --- a/src/core/control/latex/LatexGenerator.cpp +++ b/src/core/control/latex/LatexGenerator.cpp @@ -95,7 +95,7 @@ auto LatexGenerator::asyncRun(const fs::path& texDir, const std::string& texFile return {proc}; } std::ostringstream ss; - for (char** iter = argv.get(); iter != nullptr && *iter != nullptr ; ++iter) { + for (char** iter = argv.get(); iter != nullptr && *iter != nullptr; ++iter) { ss << std::string_view(*iter) << ", "; } return GenError({FS(_F("Could not start {1}: {2} (exit code: {3}, {4})") % ss.str() % err->message % err->code % diff --git a/src/core/control/settings/Settings.cpp b/src/core/control/settings/Settings.cpp index e82b9e83ec11..9cc3f820bf05 100644 --- a/src/core/control/settings/Settings.cpp +++ b/src/core/control/settings/Settings.cpp @@ -626,7 +626,7 @@ void Settings::parseItem2(xmlChar* name, xmlChar* value) { } void Settings::parseItem(xmlDocPtr doc, xmlNodePtr cur) { - // Parse data map + // Parse data map if (!xmlStrcmp(cur->name, reinterpret_cast("data"))) { xmlChar* name = xmlGetProp(cur, reinterpret_cast("name")); if (name == nullptr) { diff --git a/src/core/control/tools/EditSelectionContents.cpp b/src/core/control/tools/EditSelectionContents.cpp index 3fc73f28caae..b73a7f529f99 100644 --- a/src/core/control/tools/EditSelectionContents.cpp +++ b/src/core/control/tools/EditSelectionContents.cpp @@ -387,7 +387,8 @@ InsertionOrder EditSelectionContents::makeMoveEffective(const xoj::util::Rectang } if (rotate) { e->rotate({snappedBounds.x + this->lastSnappedBounds.width / 2, - snappedBounds.y + this->lastSnappedBounds.height / 2}, this->rotation); + snappedBounds.y + this->lastSnappedBounds.height / 2}, + this->rotation); } } this->selected.clear(); diff --git a/src/core/control/tools/StrokeHandler.cpp b/src/core/control/tools/StrokeHandler.cpp index 1d03faef7580..b77d97b821e7 100644 --- a/src/core/control/tools/StrokeHandler.cpp +++ b/src/core/control/tools/StrokeHandler.cpp @@ -117,7 +117,8 @@ void StrokeHandler::paintTo(Point point) { void StrokeHandler::drawSegmentTo(const Point& point) { this->stroke->addPoint(this->hasPressure ? point : Point(point.x, point.y)); - this->viewPool->dispatch(xoj::view::StrokeToolView::ADD_POINT_REQUEST, this->stroke->getPointVectorReviewPls().back()); + this->viewPool->dispatch(xoj::view::StrokeToolView::ADD_POINT_REQUEST, + this->stroke->getPointVectorReviewPls().back()); return; } diff --git a/src/core/control/xojfile/LoadHandler.cpp b/src/core/control/xojfile/LoadHandler.cpp index 1c78cbce8797..7c7c088b09dc 100644 --- a/src/core/control/xojfile/LoadHandler.cpp +++ b/src/core/control/xojfile/LoadHandler.cpp @@ -977,7 +977,8 @@ void LoadHandler::fixNullPressureValues() { strokeOwn->setTransformation(stroke->getTransformation()); strokeOwn->applyStyleFrom(stroke); strokeOwn->setPointVector(std::move(points)); - // stroke = strokeOwn.get(); // Removed: Either all or none of the strokes should be handled after this point + // stroke = strokeOwn.get(); // Removed: Either all or none of the strokes should be handled after this + // point layer->addElement(std::move(strokeOwn)); }); diff --git a/src/core/model/AudioElement.h b/src/core/model/AudioElement.h index 0f1c62f6e5de..14ff7a1a46a0 100644 --- a/src/core/model/AudioElement.h +++ b/src/core/model/AudioElement.h @@ -12,6 +12,7 @@ #pragma once #include // for size_t + #include "util/Point.h" #include "Element.h" // for Element, ElementType diff --git a/src/core/model/Image.cpp b/src/core/model/Image.cpp index cf6e7f403d5c..2d25cdd07e2a 100644 --- a/src/core/model/Image.cpp +++ b/src/core/model/Image.cpp @@ -165,8 +165,8 @@ void Image::readSerialized(ObjectInputStream& in) { this->Element::readSerialized(in); - - imageSize.first = in.readDouble(); // Todo: + + imageSize.first = in.readDouble(); // Todo: imageSize.second = in.readDouble(); // Todo: if (this->image) { @@ -180,7 +180,7 @@ void Image::readSerialized(ObjectInputStream& in) { this->internalUpdateBounds(); } -auto Image::internalUpdateBounds() const -> std::pair, xoj::util::Rectangle>{ +auto Image::internalUpdateBounds() const -> std::pair, xoj::util::Rectangle> { auto sizes = getImageSize(); auto rect = Rectangle(0, 0, sizes.first, sizes.second); return {rect, rect}; @@ -188,7 +188,9 @@ auto Image::internalUpdateBounds() const -> std::pair bool { return !this->data.empty(); } -auto Image::getRawData() const -> const unsigned char* { return reinterpret_cast(this->data.data()); } +auto Image::getRawData() const -> const unsigned char* { + return reinterpret_cast(this->data.data()); +} auto Image::getRawDataLength() const -> size_t { return this->data.size(); } diff --git a/src/core/model/Image.h b/src/core/model/Image.h index 458d12c5b4e1..5b86a1a44e2c 100644 --- a/src/core/model/Image.h +++ b/src/core/model/Image.h @@ -32,7 +32,7 @@ class Image final: public Element { Image(Image const&) = delete; auto operator=(Image&&) -> Image& = delete; auto operator=(Image const&) -> Image& = delete; - ~Image() override; + ~Image() override; public: /// Set the image data by copying the data from the provided string_view. @@ -93,7 +93,7 @@ class Image final: public Element { /// Image format information. mutable GdkPixbufFormat* format = nullptr; - mutable std::pair imageSize = {0,0}; + mutable std::pair imageSize = {0, 0}; std::string data; }; diff --git a/src/core/model/Stroke.h b/src/core/model/Stroke.h index ca168e6aa025..e55082968695 100644 --- a/src/core/model/Stroke.h +++ b/src/core/model/Stroke.h @@ -74,15 +74,16 @@ class Stroke final: public AudioElement { * @brief Create a partial clone whose points are those of parameters between lowerBound and upperBound * Assumes both lowerBound and upperBound are valid parameters of the stroke, and lowerBound <= upperBound */ - auto cloneSection(const PathParameter& lowerBound, const PathParameter& upperBound) const -> std::unique_ptr; + auto cloneSection(const PathParameter& lowerBound, const PathParameter& upperBound) const + -> std::unique_ptr; /** * @brief Create a partial clone of a closed stroke (i.e. points.front() == points.back()) with points * getPoint(startParam) -- ... -- points.back() == points.front() -- ... -- getPoint(endParam) * Assumes both startParam and endParam are valid parameters of the stroke, and endParam.index < startParam.index */ - auto cloneCircularSectionOfClosedStroke(const PathParameter& startParam, - const PathParameter& endParam) const -> std::unique_ptr; + auto cloneCircularSectionOfClosedStroke(const PathParameter& startParam, const PathParameter& endParam) const + -> std::unique_ptr; /** * Clone style attributes, but not the data (position, width etc.) @@ -116,13 +117,13 @@ class Stroke final: public AudioElement { /// Function should be used with caution, mostly the transformation matrix is required /// Returns original untranslated points auto getPointVector() const -> std::vector const&; - //auto getPointVectorFail() const -> std::pair const&>; + // auto getPointVectorFail() const -> std::pair const&>; /// Function should be used with caution, mostly the transformation matrix is required - /// Curious, if this is still correct, pls review ALL occurences - auto getPointVectorReviewPls() const -> std::vector const& {return getPointVector();} + /// Curious, if this is still correct, pls review ALL occurences + auto getPointVectorReviewPls() const -> std::vector const& { return getPointVector(); } /// Known to be an issue, but not fixed yet !!!Todo!!! - auto getPointVectorTodo() const -> std::vector const& {return getPointVector();} - + auto getPointVectorTodo() const -> std::vector const& { return getPointVector(); } + auto getPoint(size_t index) const -> Point; auto getPoint(PathParameter parameter) const -> Point; auto getPoints() const -> const Point*; @@ -161,8 +162,8 @@ class Stroke final: public AudioElement { * Warning: this function does not test if the box intersects the stroke's bounding box. * For optimization purposes, this test should be performed beforehand by the caller. */ - auto intersectWithPaddedBox(const PaddedBox& box, size_t firstIndex, - size_t lastIndex) const -> IntersectionParametersContainer; + auto intersectWithPaddedBox(const PaddedBox& box, size_t firstIndex, size_t lastIndex) const + -> IntersectionParametersContainer; auto intersectWithPaddedBox(const PaddedBox& box) const -> IntersectionParametersContainer; diff --git a/src/core/model/TexImage.h b/src/core/model/TexImage.h index 5a76927fc6ee..12bb613979e3 100644 --- a/src/core/model/TexImage.h +++ b/src/core/model/TexImage.h @@ -77,9 +77,9 @@ class TexImage: public Element { private: // cache: xoj::util::Rectangle bounds{}; - std::string binaryData; ///< PDF Documents binary data, must stay alive as long as the PDF is used - xoj::util::GObjectSPtr pdf; ///< + std::string binaryData; ///< PDF Documents binary data, must stay alive as long as the PDF is used + xoj::util::GObjectSPtr pdf; ///< // data: - std::string text; ///< tex expression + std::string text; ///< tex expression }; diff --git a/src/core/model/Text.h b/src/core/model/Text.h index a5fe47daed4b..f45ead7bee0b 100644 --- a/src/core/model/Text.h +++ b/src/core/model/Text.h @@ -74,12 +74,12 @@ class Text: public AudioElement { auto findText(const std::string& search) const -> std::vector; private: -// cache: + // cache: xoj::util::GObjectSPtr layout; -// data: + // data: std::string text; std::pair sizes{0, 0}; - + XojFont font{"Sans", 12}; bool inEditing = false; diff --git a/src/core/plugin/Plugin.cpp b/src/core/plugin/Plugin.cpp index bdb717be39f0..6cf764f87a70 100644 --- a/src/core/plugin/Plugin.cpp +++ b/src/core/plugin/Plugin.cpp @@ -1,27 +1,24 @@ +#ifdef ENABLE_PLUGINS + #include "Plugin.h" #include // for max #include // for array +#include // for move, pair #include // for GdkModifierType #include // for G_CALLBACK, g_signal_connect #include // for g_key_file_free, g_warning, g_free -#include "util/Assert.h" // for xoj_assert -#include "util/PathUtil.h" // for toGFilename -#include "util/XojMsgBox.h" // for XojMsgBox - -#include "config-features.h" // for ENABLE_PLUGINS - -#ifdef ENABLE_PLUGINS - -#include // for move, pair - #include "gui/toolbarMenubar/ToolMenuHandler.h" // for ToolMenuHandler +#include "util/Assert.h" // for xoj_assert +#include "util/PathUtil.h" // for toGFilename +#include "util/XojMsgBox.h" // for XojMsgBox #include "util/i18n.h" // for _ #include "util/raii/GObjectSPtr.h" -#include "config.h" // for PROJECT_VERSION +#include "config-features.h" // for ENABLE_PLUGINS +#include "config.h" // for PROJECT_VERSION extern "C" { #include // for luaL_Reg, luaL_newstate, luaL_requiref @@ -250,7 +247,8 @@ void Plugin::loadScript() { XojMsgBox::showPluginMessage(name, errMsg, true); // Error out if file can't be read - g_warning("Could not load plugin Lua file. Error: \"%s\", error code: %d (syntax error: %s)", errMsg, status, status == LUA_ERRSYNTAX ? "true" : "false"); + g_warning("Could not load plugin Lua file. Error: \"%s\", error code: %d (syntax error: %s)", errMsg, status, + status == LUA_ERRSYNTAX ? "true" : "false"); this->valid = false; return; } diff --git a/src/core/plugin/luapi_application.h b/src/core/plugin/luapi_application.h index 8faaaa3b123c..7e8a5f6f3eaf 100644 --- a/src/core/plugin/luapi_application.h +++ b/src/core/plugin/luapi_application.h @@ -2267,7 +2267,7 @@ static int applib_scaleTextElements(lua_State* L) { for (auto const& e: elements) { if (e->getType() == ELEMENT_TEXT) { Text* t = static_cast(e.get()); - t->scale(t->getX(), t->getY(), f, f, 0.0, false); + t->scale({t->getX(), t->getY()}, f, f, false); } } diff --git a/src/core/view/ElementView.cpp b/src/core/view/ElementView.cpp index d0a4b330f7ac..85ed06dd4ba6 100644 --- a/src/core/view/ElementView.cpp +++ b/src/core/view/ElementView.cpp @@ -1,4 +1,5 @@ #include // for make_unique, unique_ptr + #include #include "model/Element.h" // for Element, ELEMENT_IMAGE, ELEMENT_STROKE @@ -33,14 +34,12 @@ auto ElementView::createFromElement(const Element* e) -> std::unique_ptr cairo_matrix_t{ - return {mtx.a, mtx.c, mtx.b, mtx.d, mtx.tx, mtx.ty}; -} +auto toCairo(xoj::util::Matrix const& mtx) -> cairo_matrix_t { return {mtx.a, mtx.c, mtx.b, mtx.d, mtx.tx, mtx.ty}; } -auto ElementView::applyTransform(cairo_t* cr, const Element* e) -> void{ +auto ElementView::applyTransform(cairo_t* cr, const Element* e) -> void { cairo_matrix_t matrix; cairo_get_matrix(cr, &matrix); cairo_matrix_t elementMatrix = toCairo(e->getTransformation()); - cairo_matrix_multiply(&matrix, &elementMatrix , &matrix); + cairo_matrix_multiply(&matrix, &elementMatrix, &matrix); cairo_set_matrix(cr, &matrix); } \ No newline at end of file diff --git a/src/core/view/ErasableStrokeView.cpp b/src/core/view/ErasableStrokeView.cpp index 0a497e5ff4ae..2d004c1325aa 100644 --- a/src/core/view/ErasableStrokeView.cpp +++ b/src/core/view/ErasableStrokeView.cpp @@ -5,6 +5,7 @@ #include // for next #include // for allocator_traits<>::value_type #include // for vector + #include #include "model/LineStyle.h" // for LineStyle @@ -44,7 +45,7 @@ void ErasableStrokeView::draw(cairo_t* cr) const { xoj::util::CairoSaveGuard guard(cr); cairo_matrix_t matrix2{tm.a, tm.b, tm.c, tm.d, tm.tx, tm.ty}; cairo_matrix_t matrix; - cairo_get_matrix(cr, &matrix); + cairo_get_matrix(cr, &matrix); cairo_matrix_multiply(&matrix, &matrix, &matrix2); cairo_set_matrix(cr, &matrix); @@ -78,7 +79,7 @@ void ErasableStrokeView::draw(cairo_t* cr) const { cairo_line_to(cr, q.x, q.y); cairo_stroke(cr); } - } else { // Todo: pressure is still scaled by the transformation matrix + } else { // Todo: pressure is still scaled by the transformation matrix cairo_set_line_width(cr, stroke.getWidth()); Util::cairo_set_dash_from_vector(cr, dashes, 0); diff --git a/src/core/view/ImageView.cpp b/src/core/view/ImageView.cpp index 46ac9dec939a..86d7fc6ee7db 100644 --- a/src/core/view/ImageView.cpp +++ b/src/core/view/ImageView.cpp @@ -17,7 +17,7 @@ void ImageView::draw(const Context& ctx) const { util::CairoSaveGuard saveGuard(cr); applyTransform(cr, image); auto pattern = cairo_pattern_create_for_surface(image->getImage()); - cairo_set_source (cr, pattern); + cairo_set_source(cr, pattern); // make images translucent when highlighting elements with audio, as they can not have audio if (ctx.fadeOutNonAudio) { cairo_paint_with_alpha(cr, OPACITY_NO_AUDIO); diff --git a/src/core/view/View.h b/src/core/view/View.h index 8ba470f15d50..927c82ff6dd0 100644 --- a/src/core/view/View.h +++ b/src/core/view/View.h @@ -15,6 +15,7 @@ #include #include + #include "util/raii/CairoWrappers.h" class Element; diff --git a/src/core/view/overlays/StrokeToolView.cpp b/src/core/view/overlays/StrokeToolView.cpp index 91ad1f50b82b..fde9dc94fdb1 100644 --- a/src/core/view/overlays/StrokeToolView.cpp +++ b/src/core/view/overlays/StrokeToolView.cpp @@ -19,7 +19,9 @@ using namespace xoj::view; StrokeToolView::StrokeToolView(const StrokeHandler* strokeHandler, const Stroke& stroke, Repaintable* parent): - BaseStrokeToolView(parent, stroke), strokeHandler(strokeHandler), pointBuffer(stroke.getPointVectorReviewPls()) { + BaseStrokeToolView(parent, stroke), + strokeHandler(strokeHandler), + pointBuffer(stroke.getPointVectorReviewPls()) { this->registerToPool(strokeHandler->getViewPool()); parent->flagDirtyRegion(Range(stroke.boundingRect())); } @@ -84,7 +86,7 @@ void StrokeToolView::on(StrokeToolView::AddPointRequest, const Point& p) { xoj_assert(!this->pointBuffer.empty()); // front() is the last point we painted on the mask (see flushBuffer()) Point lastPoint = matrix * this->pointBuffer.back(); this->pointBuffer.emplace_back(p); - this->parent->flagDirtyRegion(this->getRepaintRange(lastPoint, matrix*p)); + this->parent->flagDirtyRegion(this->getRepaintRange(lastPoint, matrix * p)); } void StrokeToolView::on(StrokeToolView::ThickenFirstPointRequest, double newWidth) { diff --git a/src/exe/main.cpp b/src/exe/main.cpp index ce8a40f08cb5..c3aeba4bb65d 100644 --- a/src/exe/main.cpp +++ b/src/exe/main.cpp @@ -1,3 +1 @@ -int main(){ - return 0; -} \ No newline at end of file +int main() { return 0; } \ No newline at end of file diff --git a/src/util/Rectangle.cpp b/src/util/Rectangle.cpp index 659ddd22b8d4..7860282d0b6e 100644 --- a/src/util/Rectangle.cpp +++ b/src/util/Rectangle.cpp @@ -1,10 +1,10 @@ #include "util/Rectangle.h" +#include + #include "util/Matrix.h" #include "util/detail/MatrixMultiply.h" -#include - namespace xoj::util { auto operator*(const Matrix& matrix, const Rectangle& rect) -> Rectangle { @@ -12,10 +12,10 @@ auto operator*(const Matrix& matrix, const Rectangle& rect) -> Rectangle } constexpr auto multiply2(const Matrix& matrix, const Rectangle& rect) -> Rectangle { - auto p1 = multiply(matrix , Point{rect.x, rect.y}); - auto p2 = multiply(matrix , Point{rect.x + rect.width, rect.y + rect.height}); - auto p3 = multiply(matrix , Point{rect.x, rect.y + rect.height}); - auto p4 = multiply(matrix , Point{rect.x + rect.width, rect.y}); + auto p1 = multiply(matrix, Point{rect.x, rect.y}); + auto p2 = multiply(matrix, Point{rect.x + rect.width, rect.y + rect.height}); + auto p3 = multiply(matrix, Point{rect.x, rect.y + rect.height}); + auto p4 = multiply(matrix, Point{rect.x + rect.width, rect.y}); auto x = std::min({p1.x, p2.x, p3.x, p4.x}); auto y = std::min({p1.y, p2.y, p3.y, p4.y}); auto w = std::max({p1.x, p2.x, p3.x, p4.x}) - x; diff --git a/src/util/include/util/Point.h b/src/util/include/util/Point.h index 4e45c807bbe3..135c93ab41be 100644 --- a/src/util/include/util/Point.h +++ b/src/util/include/util/Point.h @@ -45,4 +45,4 @@ struct Point { T x{}; T y{}; }; -} // namespace util +} // namespace xoj::util diff --git a/src/util/include/util/Rectangle.h b/src/util/include/util/Rectangle.h index 7a40b65ebe8b..6c4300e02293 100644 --- a/src/util/include/util/Rectangle.h +++ b/src/util/include/util/Rectangle.h @@ -12,8 +12,8 @@ #pragma once #include -#include #include +#include #include "util/Range.h" @@ -29,7 +29,7 @@ class Rectangle final { constexpr auto operator==(const Rectangle& other) const -> bool { return x == other.x && y == other.y && width == other.width && height == other.height; - } + } /** * Returns whether this rectangle intersects another and the intersection @@ -80,7 +80,7 @@ class Rectangle final { * Calculates the area */ T area() const { return width * height; } - + friend auto operator<<(std::ostream& os, Rectangle const& r) -> std::ostream&; T x{}; @@ -90,9 +90,7 @@ class Rectangle final { }; - - struct Matrix; -auto operator*(const Matrix &matrix, const Rectangle &rect) -> Rectangle; +auto operator*(const Matrix& matrix, const Rectangle& rect) -> Rectangle; } // namespace xoj::util diff --git a/src/util/include/util/detail/MatrixMultiply.h b/src/util/include/util/detail/MatrixMultiply.h index 6a63b676421b..e274aae4d42b 100644 --- a/src/util/include/util/detail/MatrixMultiply.h +++ b/src/util/include/util/detail/MatrixMultiply.h @@ -5,7 +5,6 @@ #include "util/Rectangle.h" - namespace xoj::util { inline namespace detail {