automatic version update by autodist [release 1.4-1mamba;Sat Oct 12 2024]
This commit is contained in:
parent
19a0b84bcf
commit
cebbbceb9c
@ -1,31 +0,0 @@
|
||||
From 877fc26483f74f951eab516f1b57b136780a8c78 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Boles <dboles.src+inkscape@gmail.com>
|
||||
Date: Mon, 4 Sep 2023 10:02:09 +0100
|
||||
Subject: [PATCH] FilterEffectsDial: rm <T> on own ctor breaks C++20
|
||||
|
||||
The `<T>` on our constructor here is redundant anyway, but _somehow_ in
|
||||
C++20 it confuses the compiler and makes the file not build. Remove it!
|
||||
---
|
||||
src/ui/dialog/filter-effects-dialog.cpp | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp
|
||||
index 2c1b69dbcb6..f1be9c682f5 100644
|
||||
--- a/src/ui/dialog/filter-effects-dialog.cpp
|
||||
+++ b/src/ui/dialog/filter-effects-dialog.cpp
|
||||
@@ -194,9 +194,9 @@ template <typename T> class ComboWithTooltip
|
||||
: public ComboBoxEnum<T>
|
||||
{
|
||||
public:
|
||||
- ComboWithTooltip<T>(T default_value, const Util::EnumDataConverter<T>& c,
|
||||
- const SPAttr a = SPAttr::INVALID,
|
||||
- Glib::ustring const& tip_text = {})
|
||||
+ ComboWithTooltip(T const default_value, Util::EnumDataConverter<T> const &c,
|
||||
+ SPAttr const a = SPAttr::INVALID,
|
||||
+ Glib::ustring const &tip_text = {})
|
||||
: ComboBoxEnum<T>(default_value, c, a, false)
|
||||
{
|
||||
this->set_tooltip_text(tip_text);
|
||||
--
|
||||
GitLab
|
||||
|
@ -1,91 +0,0 @@
|
||||
From 1798e9c13b786f3d077ba0132592c4d5c1d1fb9b Mon Sep 17 00:00:00 2001
|
||||
From: Tavmjong Bah <tavmjong@free.fr>
|
||||
Date: Tue, 26 Sep 2023 19:23:27 +0000
|
||||
Subject: [PATCH] Up C++ version to C++20.
|
||||
|
||||
---
|
||||
CMakeLists.txt | 4 ++--
|
||||
_clang-format | 2 +-
|
||||
src/ui/knot/knot-holder-entity.cpp | 2 +-
|
||||
src/ui/tools/pencil-tool.cpp | 9 ++++++---
|
||||
4 files changed, 10 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index fe6b10cda24..de2680bd651 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -18,9 +18,9 @@ message("Binary Dir: ${CMAKE_CURRENT_BINARY_DIR}")
|
||||
# -----------------------------------------------------------------------------
|
||||
# CMake Configuration
|
||||
# -----------------------------------------------------------------------------
|
||||
-set(CMAKE_CXX_STANDARD 17)
|
||||
+set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
-# set(CMAKE_CXX_EXTENSIONS OFF) # enforces -std=c++17 instead of -std=gnu++17
|
||||
+# set(CMAKE_CXX_EXTENSIONS OFF) # enforces -std=c++20 instead of -std=gnu++20
|
||||
# TODO: build currently fails with it as we actually depend on GNU compiler extensions...
|
||||
# mostly use of the non-Standard M_PI et al. TODO: C++20: Use the <numbers> header.
|
||||
|
||||
diff --git a/_clang-format b/_clang-format
|
||||
index 39396fad65a..48de4d2bd88 100644
|
||||
--- a/_clang-format
|
||||
+++ b/_clang-format
|
||||
@@ -103,7 +103,7 @@ SpacesInContainerLiterals: false
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
-Standard: c++17
|
||||
+Standard: c++20
|
||||
StatementMacros: []
|
||||
TypenameMacros: []
|
||||
TabWidth: 4
|
||||
diff --git a/src/ui/knot/knot-holder-entity.cpp b/src/ui/knot/knot-holder-entity.cpp
|
||||
index 8703f5975f7..add66d2fa29 100644
|
||||
--- a/src/ui/knot/knot-holder-entity.cpp
|
||||
+++ b/src/ui/knot/knot-holder-entity.cpp
|
||||
@@ -315,7 +315,7 @@ void PatternKnotHolderEntityScale::knot_set(Geom::Point const &p, Geom::Point co
|
||||
double scale_x = std::clamp(new_extent[X] / _cached_diagonal[X], _cached_min_scale, 1e9);
|
||||
double scale_y = std::clamp(new_extent[Y] / _cached_diagonal[Y], _cached_min_scale, 1e9);
|
||||
|
||||
- Affine new_transform = (state & GDK_CONTROL_MASK) ? Scale(lerp(0.5, scale_x, scale_y))
|
||||
+ Affine new_transform = (state & GDK_CONTROL_MASK) ? Scale((scale_x + scale_y) * 0.5)
|
||||
: Scale(scale_x, scale_y);
|
||||
|
||||
// 2. Calculate offset to keep pattern origin aligned
|
||||
diff --git a/src/ui/tools/pencil-tool.cpp b/src/ui/tools/pencil-tool.cpp
|
||||
index fd2d08cad0c..7324f7c8515 100644
|
||||
--- a/src/ui/tools/pencil-tool.cpp
|
||||
+++ b/src/ui/tools/pencil-tool.cpp
|
||||
@@ -17,7 +17,11 @@
|
||||
* Released under GNU GPL v2+, read the file 'COPYING' for more information.
|
||||
*/
|
||||
|
||||
-#include <numeric> // For std::accumulate
|
||||
+#include "pencil-tool.h"
|
||||
+
|
||||
+#include <cmath> // std::lerp
|
||||
+#include <numeric> // std::accumulate
|
||||
+
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
#include <glibmm/i18n.h>
|
||||
|
||||
@@ -26,7 +30,6 @@
|
||||
#include <2geom/sbasis-to-bezier.h>
|
||||
#include <2geom/svg-path-parser.h>
|
||||
|
||||
-#include "pencil-tool.h"
|
||||
|
||||
#include "context-fns.h"
|
||||
#include "desktop.h"
|
||||
@@ -806,7 +809,7 @@ void PencilTool::_addFreehandPoint(Geom::Point const &p, guint /*state*/, bool l
|
||||
min = max;
|
||||
}
|
||||
double dezoomify_factor = 0.05 * 1000 / _desktop->current_zoom();
|
||||
- double const pressure_shrunk = pressure * (max - min) + min; // C++20 -> use std::lerp()
|
||||
+ double const pressure_shrunk = std::lerp(min, max, pressure);
|
||||
double pressure_computed = std::abs(pressure_shrunk * dezoomify_factor);
|
||||
double pressure_computed_scaled = std::abs(pressure_computed * _desktop->getDocument()->getDocumentScale().inverse()[Geom::X]);
|
||||
if (p != p_array[_npoints - 1]) {
|
||||
--
|
||||
GitLab
|
||||
|
@ -1,12 +0,0 @@
|
||||
diff -ur inkscape-1.3.2_2023-11-25_091e20ef0f/share/extensions/raster_output_tiff.py inkscape-1.3.2_2023-11-25_091e20ef0f_fix/share/extensions/raster_output_tiff.py
|
||||
--- inkscape-1.3.2_2023-11-25_091e20ef0f/share/extensions/raster_output_tiff.py 2023-03-26 19:12:31.000000000 +0200
|
||||
+++ inkscape-1.3.2_2023-11-25_091e20ef0f_fix/share/extensions/raster_output_tiff.py 2024-09-12 13:02:36.671294086 +0200
|
||||
@@ -20,7 +20,6 @@
|
||||
format="tiff",
|
||||
compression=(self.options.compression or None),
|
||||
dpi=self.img.info["dpi"],
|
||||
- quality=100,
|
||||
)
|
||||
stream.write(tempstream.getvalue())
|
||||
# TODO: Add other fields such as copyright etc.
|
||||
|
@ -1,335 +0,0 @@
|
||||
From ab2650a48473cff0175c8efab2444857f9ecbb20 Mon Sep 17 00:00:00 2001
|
||||
From: PBS <pbs3141@gmail.com>
|
||||
Date: Thu, 20 Jul 2023 13:03:34 +0900
|
||||
Subject: [PATCH] Update 2geom and migrate code
|
||||
|
||||
Fixes https://gitlab.com/inkscape/inkscape/-/issues/4445
|
||||
Fixes https://gitlab.com/inkscape/inkscape/-/issues/4341
|
||||
|
||||
Also 'fixes' these pseudo non-bugs
|
||||
|
||||
Fixes https://gitlab.com/inkscape/lib2geom/-/issues/65
|
||||
Fixes https://gitlab.com/inkscape/inbox/-/issues/8912
|
||||
---
|
||||
src/3rdparty/2geom | 2 +-
|
||||
src/display/control/canvas-item.h | 6 ---
|
||||
src/helper/geom.cpp | 61 ---------------------
|
||||
src/helper/geom.h | 1 -
|
||||
src/live_effects/lpe-tiling.cpp | 2 +-
|
||||
src/trace/potrace/inkscape-potrace.cpp | 4 +-
|
||||
src/trace/potrace/inkscape-potrace.h | 14 +----
|
||||
src/ui/widget/canvas.cpp | 1 -
|
||||
src/ui/widget/canvas/stores.cpp | 9 ++--
|
||||
testfiles/CMakeLists.txt | 1 -
|
||||
testfiles/src/min-bbox-test.cpp | 73 --------------------------
|
||||
11 files changed, 10 insertions(+), 164 deletions(-)
|
||||
delete mode 100644 testfiles/src/min-bbox-test.cpp
|
||||
|
||||
diff --git a/src/display/control/canvas-item.h b/src/display/control/canvas-item.h
|
||||
index 3a5387d9e91..205234ff787 100644
|
||||
--- a/src/display/control/canvas-item.h
|
||||
+++ b/src/display/control/canvas-item.h
|
||||
@@ -148,12 +148,6 @@ protected:
|
||||
|
||||
} // namespace Inkscape
|
||||
|
||||
-// Todo: Move to lib2geom.
|
||||
-inline auto &operator<<(std::ostream &s, Geom::OptRect const &rect)
|
||||
-{
|
||||
- return rect ? (s << *rect) : (s << "(empty)");
|
||||
-}
|
||||
-
|
||||
#endif // SEEN_CANVAS_ITEM_H
|
||||
|
||||
/*
|
||||
diff --git a/src/helper/geom.cpp b/src/helper/geom.cpp
|
||||
index 30111cb8d9d..6a282a18433 100644
|
||||
--- a/src/helper/geom.cpp
|
||||
+++ b/src/helper/geom.cpp
|
||||
@@ -1010,67 +1010,6 @@ bool approx_dihedral(Geom::Affine const &affine, double eps)
|
||||
return arr == std::array {1, 0, 0, 1 } || arr == std::array{ 0, 1, 1, 0 };
|
||||
}
|
||||
|
||||
-/**
|
||||
- * Computes the rotation which puts a set of points in a position where they can be wrapped in the
|
||||
- * smallest possible axis-aligned rectangle, and returns it along with the rectangle.
|
||||
- */
|
||||
-std::pair<Geom::Affine, Geom::Rect> min_bounding_box(std::vector<Geom::Point> const &pts)
|
||||
-{
|
||||
- // Compute the convex hull.
|
||||
- auto const hull = Geom::ConvexHull(pts);
|
||||
-
|
||||
- // Move the point i along until it maximises distance in the direction n.
|
||||
- auto advance = [&] (int &i, Geom::Point const &n) {
|
||||
- auto ih = Geom::dot(hull[i], n);
|
||||
- while (true) {
|
||||
- int j = (i + 1) % hull.size();
|
||||
- auto jh = Geom::dot(hull[j], n);
|
||||
- if (ih >= jh) break;
|
||||
- i = j;
|
||||
- ih = jh;
|
||||
- }
|
||||
- };
|
||||
-
|
||||
- double mina = std::numeric_limits<double>::max();
|
||||
- std::pair<Geom::Affine, Geom::Rect> result;
|
||||
-
|
||||
- // Run rotating callipers.
|
||||
- int j, k, l;
|
||||
- for (int i = 0; i < hull.size(); i++) {
|
||||
- // Get the current segment.
|
||||
- auto &p1 = hull[i];
|
||||
- auto &p2 = hull[(i + 1) % hull.size()];
|
||||
- auto v = (p2 - p1).normalized();
|
||||
- auto n = Geom::Point(-v.y(), v.x());
|
||||
-
|
||||
- if (i == 0) {
|
||||
- // Initialise the points.
|
||||
- j = 0; advance(j, v);
|
||||
- k = j; advance(k, n);
|
||||
- l = k; advance(l, -v);
|
||||
- } else {
|
||||
- // Advance the points.
|
||||
- advance(j, v);
|
||||
- advance(k, n);
|
||||
- advance(l, -v);
|
||||
- }
|
||||
-
|
||||
- // Compute the dimensions of the unconstrained rectangle.
|
||||
- auto w = Geom::dot(hull[j] - hull[l], v);
|
||||
- auto h = Geom::dot(hull[k] - hull[i], n);
|
||||
- auto a = w * h;
|
||||
-
|
||||
- // Track the minimum.
|
||||
- if (a < mina) {
|
||||
- mina = a;
|
||||
- result = std::make_pair(Geom::Affine(v.x(), -v.y(), v.y(), v.x(), 0.0, 0.0),
|
||||
- Geom::Rect::from_xywh(Geom::dot(hull[l], v), Geom::dot(hull[i], n), w, h));
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- return result;
|
||||
-}
|
||||
-
|
||||
/*
|
||||
Local Variables:
|
||||
mode:c++
|
||||
diff --git a/src/helper/geom.h b/src/helper/geom.h
|
||||
index 50e434da780..59542e7d44f 100644
|
||||
--- a/src/helper/geom.h
|
||||
+++ b/src/helper/geom.h
|
||||
@@ -45,7 +45,6 @@ void recursive_bezier4(const double x1, const double y1, const double x2, const
|
||||
std::vector<Geom::Point> &pointlist,
|
||||
int level);
|
||||
bool approx_dihedral(Geom::Affine const &affine, double eps = 0.0001);
|
||||
-std::pair<Geom::Affine, Geom::Rect> min_bounding_box(std::vector<Geom::Point> const &pts);
|
||||
|
||||
/// Returns signed area of triangle given by points; may be negative.
|
||||
inline Geom::Coord triangle_area(Geom::Point const &p1, Geom::Point const &p2, Geom::Point const &p3)
|
||||
diff --git a/src/live_effects/lpe-tiling.cpp b/src/live_effects/lpe-tiling.cpp
|
||||
index b4913c79b2d..5bd88801475 100644
|
||||
--- a/src/live_effects/lpe-tiling.cpp
|
||||
+++ b/src/live_effects/lpe-tiling.cpp
|
||||
@@ -442,7 +442,7 @@ LPETiling::doAfterEffect (SPLPEItem const* lpeitem, SPCurve *curve)
|
||||
auto p = Geom::Point(xset + offset_x - random_x[counter], yset + offset_y - random_y[counter]);
|
||||
auto translate = p * gap.inverse();
|
||||
Geom::Affine finalit = (transformoriginal * Geom::Translate(spcenter_base).inverse() * mirror * Geom::Translate(spcenter_base));
|
||||
- finalit *= gapp.inverse() * Geom::Translate(spcenter).inverse() * originatrans.withoutTranslation().inverse() * r * translate * Geom::Translate(spcenter) ;
|
||||
+ finalit *= gapp.inverse() * Geom::Translate(spcenter).inverse() * originatrans.withoutTranslation().inverse() * r * Geom::Translate(translate) * Geom::Translate(spcenter);
|
||||
item->doWriteTransform(finalit);
|
||||
item->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
|
||||
forcewrite = forcewrite || write;
|
||||
diff --git a/src/trace/potrace/inkscape-potrace.cpp b/src/trace/potrace/inkscape-potrace.cpp
|
||||
index a6c7f65f92a..e51a5afb104 100644
|
||||
--- a/src/trace/potrace/inkscape-potrace.cpp
|
||||
+++ b/src/trace/potrace/inkscape-potrace.cpp
|
||||
@@ -93,7 +93,7 @@ void PotraceTracingEngine::setTurdSize(int turdsize)
|
||||
* Recursively descend the potrace_path_t node tree \a paths, writing paths to \a builder.
|
||||
* The \a points set is used to prevent redundant paths.
|
||||
*/
|
||||
-void PotraceTracingEngine::writePaths(potrace_path_t *paths, Geom::PathBuilder &builder, std::unordered_set<Geom::Point, geom_point_hash> &points, Async::Progress<double> &progress) const
|
||||
+void PotraceTracingEngine::writePaths(potrace_path_t *paths, Geom::PathBuilder &builder, std::unordered_set<Geom::Point> &points, Async::Progress<double> &progress) const
|
||||
{
|
||||
auto to_geom = [] (potrace_dpoint_t const &c) {
|
||||
return Geom::Point(c.x, c.y);
|
||||
@@ -280,7 +280,7 @@ Geom::PathVector PotraceTracingEngine::grayMapToPath(GrayMap const &grayMap, Asy
|
||||
|
||||
// Extract the paths into a pathvector and return it.
|
||||
Geom::PathBuilder builder;
|
||||
- std::unordered_set<Geom::Point, geom_point_hash> points;
|
||||
+ std::unordered_set<Geom::Point> points;
|
||||
writePaths(potraceState->plist, builder, points, progress);
|
||||
return builder.peek();
|
||||
}
|
||||
diff --git a/src/trace/potrace/inkscape-potrace.h b/src/trace/potrace/inkscape-potrace.h
|
||||
index 0e4a9c62eeb..f30568369b2 100644
|
||||
--- a/src/trace/potrace/inkscape-potrace.h
|
||||
+++ b/src/trace/potrace/inkscape-potrace.h
|
||||
@@ -45,18 +45,6 @@ enum class TraceType
|
||||
AUTOTRACE_CENTERLINE
|
||||
};
|
||||
|
||||
-// Todo: Make lib2geom types hashable.
|
||||
-struct geom_point_hash
|
||||
-{
|
||||
- std::size_t operator()(Geom::Point const &pt) const
|
||||
- {
|
||||
- std::size_t hash = 0;
|
||||
- boost::hash_combine(hash, pt.x());
|
||||
- boost::hash_combine(hash, pt.y());
|
||||
- return hash;
|
||||
- }
|
||||
-};
|
||||
-
|
||||
class PotraceTracingEngine final
|
||||
: public TracingEngine
|
||||
{
|
||||
@@ -119,7 +107,7 @@ private:
|
||||
|
||||
Geom::PathVector grayMapToPath(GrayMap const &gm, Async::Progress<double> &progress);
|
||||
|
||||
- void writePaths(potrace_path_t *paths, Geom::PathBuilder &builder, std::unordered_set<Geom::Point, geom_point_hash> &points, Async::Progress<double> &progress) const;
|
||||
+ void writePaths(potrace_path_t *paths, Geom::PathBuilder &builder, std::unordered_set<Geom::Point> &points, Async::Progress<double> &progress) const;
|
||||
};
|
||||
|
||||
} // namespace Potrace
|
||||
diff --git a/src/ui/widget/canvas.cpp b/src/ui/widget/canvas.cpp
|
||||
index 7274d0a30f5..86fb95a54c7 100644
|
||||
--- a/src/ui/widget/canvas.cpp
|
||||
+++ b/src/ui/widget/canvas.cpp
|
||||
@@ -18,7 +18,6 @@
|
||||
#include <cassert>
|
||||
#include <boost/asio/thread_pool.hpp>
|
||||
#include <boost/asio/post.hpp>
|
||||
-#include <2geom/convex-hull.h>
|
||||
|
||||
#include "canvas.h"
|
||||
|
||||
diff --git a/src/ui/widget/canvas/stores.cpp b/src/ui/widget/canvas/stores.cpp
|
||||
index 70327f5a48b..e51598de456 100644
|
||||
--- a/src/ui/widget/canvas/stores.cpp
|
||||
+++ b/src/ui/widget/canvas/stores.cpp
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <2geom/transforms.h>
|
||||
#include <2geom/parallelogram.h>
|
||||
#include <2geom/point.h>
|
||||
+#include <2geom/convex-hull.h>
|
||||
#include "helper/geom.h"
|
||||
#include "ui/util.h"
|
||||
#include "stores.h"
|
||||
@@ -61,8 +62,7 @@ auto region_affine_approxinwards(Cairo::RefPtr<Cairo::Region> const ®, Geom::
|
||||
double fx = min(absolute(Geom::Point(1.0, 0.0) * affine.withoutTranslation()));
|
||||
double fy = min(absolute(Geom::Point(0.0, 1.0) * affine.withoutTranslation()));
|
||||
|
||||
- for (int i = 0; i < regsrc->get_num_rectangles(); i++)
|
||||
- {
|
||||
+ for (int i = 0; i < regsrc->get_num_rectangles(); i++) {
|
||||
auto rect = cairo_to_geom(regsrc->get_rectangle(i));
|
||||
int nx = std::ceil(rect.width() * fx / d);
|
||||
int ny = std::ceil(rect.height() * fy / d);
|
||||
@@ -147,8 +147,9 @@ void Stores::snapshot_combine(Fragment const &view)
|
||||
add_rect(Geom::Parallelogram(_snapshot.rect) * _snapshot.affine.inverse() * view.affine);
|
||||
|
||||
// Compute their minimum-area bounding box as a fragment - an (affine, rect) pair.
|
||||
- auto [affine, rect] = min_bounding_box(pts);
|
||||
- affine = view.affine * affine;
|
||||
+ auto const [rot, optrect] = Geom::ConvexHull(pts).minAreaRotation();
|
||||
+ auto rect = *optrect; // non-empty since pts is non-empty
|
||||
+ auto affine = view.affine * rot;
|
||||
|
||||
// Check if the paste transform takes the snapshot store exactly onto the new fragment, possibly with a dihedral transformation.
|
||||
auto paste = Geom::Scale(_snapshot.rect.dimensions())
|
||||
diff --git a/testfiles/CMakeLists.txt b/testfiles/CMakeLists.txt
|
||||
index dc0cbd6ac45..15f68eb439d 100644
|
||||
--- a/testfiles/CMakeLists.txt
|
||||
+++ b/testfiles/CMakeLists.txt
|
||||
@@ -69,7 +69,6 @@ set(TEST_SOURCES
|
||||
attributes-test
|
||||
color-profile-test
|
||||
dir-util-test
|
||||
- min-bbox-test
|
||||
oklab-color-test
|
||||
sp-object-test
|
||||
sp-object-tags-test
|
||||
diff --git a/testfiles/src/min-bbox-test.cpp b/testfiles/src/min-bbox-test.cpp
|
||||
deleted file mode 100644
|
||||
index ccacd625a83..00000000000
|
||||
--- a/testfiles/src/min-bbox-test.cpp
|
||||
+++ /dev/null
|
||||
@@ -1,73 +0,0 @@
|
||||
-// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
-#include <2geom/convex-hull.h>
|
||||
-#include <2geom/transforms.h>
|
||||
-#include <gtest/gtest.h>
|
||||
-#include <helper/geom.h>
|
||||
-
|
||||
-// Get the axis-aligned bouding box of a set of points, transforming by affine first.
|
||||
-auto aligned_bbox(std::vector<Geom::Point> const &pts, Geom::Affine const &affine = Geom::identity())
|
||||
-{
|
||||
- Geom::OptRect rect;
|
||||
- for (auto &pt : pts) {
|
||||
- rect.expandTo(pt * affine);
|
||||
- }
|
||||
- return rect;
|
||||
-}
|
||||
-
|
||||
-double area(Geom::OptRect const &rect)
|
||||
-{
|
||||
- return rect ? rect->area() : 0.0;
|
||||
-}
|
||||
-
|
||||
-// Get an approximation to the minimum bouding box area.
|
||||
-double approx_min(std::vector<Geom::Point> const &pts)
|
||||
-{
|
||||
- int constexpr N = 100;
|
||||
-
|
||||
- double min = std::numeric_limits<double>::max();
|
||||
-
|
||||
- for (int i = 0; i < N; i++) {
|
||||
- auto t = (double)i / N * M_PI * 0.5;
|
||||
- min = std::min(min, area(aligned_bbox(pts, Geom::Rotate(t))));
|
||||
- }
|
||||
-
|
||||
- return min;
|
||||
-}
|
||||
-
|
||||
-// Get a crude random double.
|
||||
-double ranf()
|
||||
-{
|
||||
- int constexpr N = 1000;
|
||||
- return (double)(rand() % N) / N;
|
||||
-}
|
||||
-
|
||||
-// Get a random collection of points.
|
||||
-auto randpts()
|
||||
-{
|
||||
- std::vector<Geom::Point> pts;
|
||||
-
|
||||
- int count = 5 + (rand() % 10);
|
||||
- for (int i = 0; i < count; i++) {
|
||||
- pts.emplace_back(ranf(), ranf());
|
||||
- }
|
||||
-
|
||||
- return pts;
|
||||
-}
|
||||
-
|
||||
-TEST(MinBBoxTest, random)
|
||||
-{
|
||||
- for (int i = 0; i < 100; i++) {
|
||||
- auto const pts = randpts();
|
||||
- auto [affine, rect] = min_bounding_box(pts);
|
||||
-
|
||||
- ASSERT_TRUE(affine.isRotation());
|
||||
-
|
||||
- auto rect2 = aligned_bbox(pts, affine);
|
||||
- for (int i = 0; i < 2; i++) {
|
||||
- ASSERT_NEAR(rect.min()[i], rect2->min()[i], 1e-5);
|
||||
- ASSERT_NEAR(rect.max()[i], rect2->max()[i], 1e-5);
|
||||
- }
|
||||
-
|
||||
- ASSERT_LE(rect.area(), approx_min(pts));
|
||||
- }
|
||||
-}
|
||||
--
|
||||
GitLab
|
||||
|
@ -1,33 +0,0 @@
|
||||
From 694d8ae43d06efff21adebf377ce614d660b24cd Mon Sep 17 00:00:00 2001
|
||||
From: Christian Hesse <mail@eworm.de>
|
||||
Date: Fri, 17 Nov 2023 22:30:42 +0100
|
||||
Subject: [PATCH] include missing header file
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This fixes build error:
|
||||
```
|
||||
/build/inkscape/src/inkscape/src/object/uri.cpp: In constructor ‘Inkscape::URI::URI(const gchar*, const char*)’:
|
||||
/build/inkscape/src/inkscape/src/object/uri.cpp:86:9: error: ‘xmlFree’ was not declared in this scope; did you mean ‘xmlFreeURI’?
|
||||
86 | xmlFree(full);
|
||||
```
|
||||
---
|
||||
src/object/uri.h | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/object/uri.h b/src/object/uri.h
|
||||
index 381adec58cf..d5b211fe2b2 100644
|
||||
--- a/src/object/uri.h
|
||||
+++ b/src/object/uri.h
|
||||
@@ -13,6 +13,7 @@
|
||||
#define INKSCAPE_URI_H
|
||||
|
||||
#include <libxml/uri.h>
|
||||
+#include <libxml/xmlmemory.h>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
--
|
||||
GitLab
|
||||
|
@ -1,76 +0,0 @@
|
||||
From f7e944575ea5247952d23f85dfa905cfa13f7b28 Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Sturmlechner <asturm@gentoo.org>
|
||||
Date: Mon, 4 Mar 2024 22:59:40 +0100
|
||||
Subject: [PATCH] Fix build with >=poppler-24.03.0
|
||||
|
||||
Fixes build errors caused by:
|
||||
|
||||
"Use an enum for Function getType"
|
||||
Upstream commit 6e3824d45d42cb806a28a2df84e4ab6bb3587083
|
||||
|
||||
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
|
||||
|
||||
Fixes https://gitlab.com/inkscape/inkscape/-/issues/4787
|
||||
---
|
||||
.../internal/pdfinput/poppler-transition-api.h | 10 ++++++++++
|
||||
src/extension/internal/pdfinput/svg-builder.cpp | 8 ++++----
|
||||
2 files changed, 14 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
|
||||
index 66b15d705a2..58aa1ec921d 100644
|
||||
--- a/src/extension/internal/pdfinput/poppler-transition-api.h
|
||||
+++ b/src/extension/internal/pdfinput/poppler-transition-api.h
|
||||
@@ -14,6 +14,16 @@
|
||||
|
||||
#include <glib/poppler-features.h>
|
||||
|
||||
+#if POPPLER_CHECK_VERSION(24, 3, 0)
|
||||
+#define _POPPLER_FUNCTION_TYPE_SAMPLED Function::Type::Sampled
|
||||
+#define _POPPLER_FUNCTION_TYPE_EXPONENTIAL Function::Type::Exponential
|
||||
+#define _POPPLER_FUNCTION_TYPE_STITCHING Function::Type::Stitching
|
||||
+#else
|
||||
+#define _POPPLER_FUNCTION_TYPE_SAMPLED 0
|
||||
+#define _POPPLER_FUNCTION_TYPE_EXPONENTIAL 2
|
||||
+#define _POPPLER_FUNCTION_TYPE_STITCHING 3
|
||||
+#endif
|
||||
+
|
||||
#if POPPLER_CHECK_VERSION(22, 4, 0)
|
||||
#define _POPPLER_FONTPTR_TO_GFX8(font_ptr) ((Gfx8BitFont *)font_ptr.get())
|
||||
#else
|
||||
diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp
|
||||
index 525fbfec0a8..f0a9c1ac696 100644
|
||||
--- a/src/extension/internal/pdfinput/svg-builder.cpp
|
||||
+++ b/src/extension/internal/pdfinput/svg-builder.cpp
|
||||
@@ -1175,9 +1175,9 @@ static bool svgGetShadingColor(GfxShading *shading, double offset, GfxColor *res
|
||||
#define INT_EPSILON 8
|
||||
bool SvgBuilder::_addGradientStops(Inkscape::XML::Node *gradient, GfxShading *shading,
|
||||
_POPPLER_CONST Function *func) {
|
||||
- int type = func->getType();
|
||||
+ auto type = func->getType();
|
||||
auto space = shading->getColorSpace();
|
||||
- if ( type == 0 || type == 2 ) { // Sampled or exponential function
|
||||
+ if (type == _POPPLER_FUNCTION_TYPE_SAMPLED || type == _POPPLER_FUNCTION_TYPE_EXPONENTIAL) {
|
||||
GfxColor stop1, stop2;
|
||||
if (!svgGetShadingColor(shading, 0.0, &stop1) || !svgGetShadingColor(shading, 1.0, &stop2)) {
|
||||
return false;
|
||||
@@ -1185,7 +1185,7 @@ bool SvgBuilder::_addGradientStops(Inkscape::XML::Node *gradient, GfxShading *sh
|
||||
_addStopToGradient(gradient, 0.0, &stop1, space, 1.0);
|
||||
_addStopToGradient(gradient, 1.0, &stop2, space, 1.0);
|
||||
}
|
||||
- } else if ( type == 3 ) { // Stitching
|
||||
+ } else if (type == _POPPLER_FUNCTION_TYPE_STITCHING) {
|
||||
auto stitchingFunc = static_cast<_POPPLER_CONST StitchingFunction*>(func);
|
||||
const double *bounds = stitchingFunc->getBounds();
|
||||
const double *encode = stitchingFunc->getEncode();
|
||||
@@ -1200,7 +1200,7 @@ bool SvgBuilder::_addGradientStops(Inkscape::XML::Node *gradient, GfxShading *sh
|
||||
for ( int i = 0 ; i < num_funcs ; i++ ) {
|
||||
svgGetShadingColor(shading, bounds[i + 1], &color);
|
||||
// Add stops
|
||||
- if (stitchingFunc->getFunc(i)->getType() == 2) { // process exponential fxn
|
||||
+ if (stitchingFunc->getFunc(i)->getType() == _POPPLER_FUNCTION_TYPE_EXPONENTIAL) {
|
||||
double expE = (static_cast<_POPPLER_CONST ExponentialFunction*>(stitchingFunc->getFunc(i)))->getE();
|
||||
if (expE > 1.0) {
|
||||
expE = (bounds[i + 1] - bounds[i])/expE; // approximate exponential as a single straight line at x=1
|
||||
--
|
||||
GitLab
|
||||
|
@ -1,64 +0,0 @@
|
||||
From 96ca7a6c215aa14336b52753f56244dc8796ec43 Mon Sep 17 00:00:00 2001
|
||||
From: Heiko Becker <mail@heiko-becker.de>
|
||||
Date: Fri, 3 May 2024 14:52:00 +0200
|
||||
Subject: [PATCH] Fix build with poppler >= 24.05.0
|
||||
|
||||
GooString::hasUnicodeMarkerLE and GooString::hasUnicodeMarker were
|
||||
rename and moved to UTF.h [1][2]
|
||||
|
||||
[1] https://gitlab.freedesktop.org/poppler/poppler/-/commit/98fabb298b0e8eaef9193bbce68c99c85473a314
|
||||
[2] https://gitlab.freedesktop.org/poppler/poppler/-/commit/1f06dca08c32ed18c3030530d98a0e30d41dd7a2
|
||||
---
|
||||
src/extension/internal/pdfinput/poppler-transition-api.h | 9 +++++++++
|
||||
src/extension/internal/pdfinput/poppler-utils.cpp | 6 ++++--
|
||||
2 files changed, 13 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/extension/internal/pdfinput/poppler-transition-api.h b/src/extension/internal/pdfinput/poppler-transition-api.h
|
||||
index 58aa1ec921d..481aefadf46 100644
|
||||
--- a/src/extension/internal/pdfinput/poppler-transition-api.h
|
||||
+++ b/src/extension/internal/pdfinput/poppler-transition-api.h
|
||||
@@ -13,6 +13,15 @@
|
||||
#define SEEN_POPPLER_TRANSITION_API_H
|
||||
|
||||
#include <glib/poppler-features.h>
|
||||
+#include <poppler/UTF.h>
|
||||
+
|
||||
+#if POPPLER_CHECK_VERSION(24, 5, 0)
|
||||
+#define _POPPLER_HAS_UNICODE_BOM(value) (hasUnicodeByteOrderMark(value->toStr()))
|
||||
+#define _POPPLER_HAS_UNICODE_BOMLE(value) (hasUnicodeByteOrderMarkLE(value->toStr()))
|
||||
+#else
|
||||
+#define _POPPLER_HAS_UNICODE_BOM(value) (value->hasUnicodeMarker())
|
||||
+#define _POPPLER_HAS_UNICODE_BOMLE(value) (value->hasUnicodeMarkerLE())
|
||||
+#endif
|
||||
|
||||
#if POPPLER_CHECK_VERSION(24, 3, 0)
|
||||
#define _POPPLER_FUNCTION_TYPE_SAMPLED Function::Type::Sampled
|
||||
diff --git a/src/extension/internal/pdfinput/poppler-utils.cpp b/src/extension/internal/pdfinput/poppler-utils.cpp
|
||||
index 78d90c66c9d..c02815f64b9 100644
|
||||
--- a/src/extension/internal/pdfinput/poppler-utils.cpp
|
||||
+++ b/src/extension/internal/pdfinput/poppler-utils.cpp
|
||||
@@ -12,6 +12,8 @@
|
||||
|
||||
#include "poppler-utils.h"
|
||||
|
||||
+#include <poppler/UTF.h>
|
||||
+
|
||||
#include "2geom/affine.h"
|
||||
#include "GfxFont.h"
|
||||
#include "GfxState.h"
|
||||
@@ -563,10 +565,10 @@ std::string getDictString(Dict *dict, const char *key)
|
||||
*/
|
||||
std::string getString(const GooString *value)
|
||||
{
|
||||
- if (value->hasUnicodeMarker()) {
|
||||
+ if (_POPPLER_HAS_UNICODE_BOM(value)) {
|
||||
return g_convert(value->getCString () + 2, value->getLength () - 2,
|
||||
"UTF-8", "UTF-16BE", NULL, NULL, NULL);
|
||||
- } else if (value->hasUnicodeMarkerLE()) {
|
||||
+ } else if (_POPPLER_HAS_UNICODE_BOMLE(value)) {
|
||||
return g_convert(value->getCString () + 2, value->getLength () - 2,
|
||||
"UTF-8", "UTF-16LE", NULL, NULL, NULL);
|
||||
}
|
||||
--
|
||||
GitLab
|
||||
|
@ -1,7 +1,7 @@
|
||||
%define gittag INKSCAPE_%(echo %version | tr . _)
|
||||
Name: inkscape
|
||||
Version: 1.3.2
|
||||
Release: 3mamba
|
||||
Version: 1.4
|
||||
Release: 1mamba
|
||||
Summary: A SVG based generic vector-drawing application
|
||||
Group: Applications/Multimedia
|
||||
Vendor: openmamba
|
||||
@ -9,13 +9,6 @@ Distribution: openmamba
|
||||
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
|
||||
URL: https://inkscape.org/
|
||||
Source: https://gitlab.com/inkscape/inkscape.git/%{gittag}/inkscape-%{version}.tar.bz2
|
||||
Patch0: inkscape-1.3.2-poppler-24.03.0.patch
|
||||
Patch1: inkscape-1.3.2-libxml2-2.12.5.patch
|
||||
Patch2: inkscape-1.3.2-c++20.patch
|
||||
Patch3: inkscape-1.3.2-poppler-24.05.0.patch
|
||||
Patch4: inkscape-1.3.2-c++20-2.patch
|
||||
Patch5: inkscape-1.3.2-fix_tiff.patch
|
||||
Patch6: inkscape-1.3.2-lib2geom-1.4.patch
|
||||
License: GPL
|
||||
## AUTOBUILDREQ-BEGIN
|
||||
BuildRequires: glibc-devel
|
||||
@ -59,7 +52,6 @@ BuildRequires: libpotrace-devel
|
||||
BuildRequires: libreadline-devel
|
||||
BuildRequires: librevenge-devel
|
||||
BuildRequires: libsigc++2-devel
|
||||
BuildRequires: libsoup2-devel
|
||||
BuildRequires: libstdc++6-devel
|
||||
BuildRequires: libvisio-devel
|
||||
BuildRequires: libwpg-devel
|
||||
@ -90,13 +82,6 @@ Additional planned work includes conversion of the codebase from C/Gtk to C++/Gt
|
||||
%setup -q
|
||||
#-D -T
|
||||
#:<< _EOF
|
||||
%patch 0 -p1 -b .poppler-24.03.0
|
||||
%patch 1 -p1 -b .libxml2-2.12.5
|
||||
%patch 2 -p1 -F2 -b .c++20
|
||||
%patch 3 -p1 -b .poppler-24.05.0
|
||||
#% patch 4 -p1 -F2 -b .c++20-2
|
||||
%patch 5 -p1 -b .fix_tiff
|
||||
%patch 6 -p1 -b .lib2geom-1.4
|
||||
|
||||
%build
|
||||
%cmake -d build \
|
||||
@ -135,6 +120,9 @@ Additional planned work includes conversion of the codebase from C/Gtk to C++/Gt
|
||||
#%doc ChaangeLog NEWS README
|
||||
|
||||
%changelog
|
||||
* Sat Oct 12 2024 Automatic Build System <autodist@openmamba.org> 1.4-1mamba
|
||||
- automatic version update by autodist
|
||||
|
||||
* Sat Sep 21 2024 Automatic Build System <autodist@mambasoft.it> 1.3.2-3mamba
|
||||
- rebuilt by autoport with build requirements: libgspell-devel>=0:1.14.0-1mamba
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user