From 5ee4631fd2c6596c29ea129b7da48f5af17883a6 Mon Sep 17 00:00:00 2001 From: aneejit1 Date: Mon, 21 Mar 2022 15:10:55 +0000 Subject: [PATCH 1/9] Build attempts to write to the source directory (#3347) Building with a read-only source directory results in failure due to two attempts to write into the source tree. Amend the CMakeLists.txt files to write the output into the binary directory. --- share/filters/CMakeLists.txt | 8 ++++---- share/templates/CMakeLists.txt | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/share/filters/CMakeLists.txt b/share/filters/CMakeLists.txt index a1ea4db5a1..5604734b6d 100644 --- a/share/filters/CMakeLists.txt +++ b/share/filters/CMakeLists.txt @@ -1,12 +1,12 @@ # SPDX-License-Identifier: GPL-2.0-or-later add_custom_command( - OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/filters.svg.h - COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/i18n.py ${CMAKE_CURRENT_SOURCE_DIR}/filters.svg > ${CMAKE_CURRENT_SOURCE_DIR}/filters.svg.h + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/filters.svg.h + COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/i18n.py ${CMAKE_CURRENT_SOURCE_DIR}/filters.svg > ${CMAKE_CURRENT_BINARY_DIR}/filters.svg.h MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/filters.svg DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/i18n.py ) -set_source_files_properties(${CMAKE_SOURCE_DIR}/filters.svg.h PROPERTIES GENERATED TRUE) +set_source_files_properties(${CMAKE_BINARY_DIR}/filters.svg.h PROPERTIES GENERATED TRUE) -add_custom_target(filters_svg_h ALL DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/filters.svg.h) +add_custom_target(filters_svg_h ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/filters.svg.h) install(FILES "filters.svg" "README" DESTINATION ${INKSCAPE_SHARE_INSTALL}/filters) diff --git a/share/templates/CMakeLists.txt b/share/templates/CMakeLists.txt index 70665deafa..dec1230b3c 100644 --- a/share/templates/CMakeLists.txt +++ b/share/templates/CMakeLists.txt @@ -2,13 +2,13 @@ file(GLOB _FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.svg") add_custom_command( - OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/templates.h - COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/i18n.py ${_FILES} > ${CMAKE_CURRENT_SOURCE_DIR}/templates.h + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/templates.h + COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/i18n.py ${_FILES} > ${CMAKE_CURRENT_BINARY_DIR}/templates.h WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/i18n.py ${_FILES} ) -set_source_files_properties(${CMAKE_SOURCE_DIR}/templates.h PROPERTIES GENERATED TRUE) -add_custom_target(templates_h ALL DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/templates.h) +set_source_files_properties(${CMAKE_BINARY_DIR}/templates.h PROPERTIES GENERATED TRUE) +add_custom_target(templates_h ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/templates.h) install(FILES ${_FILES} "README" DESTINATION ${INKSCAPE_SHARE_INSTALL}/templates) -- GitLab From b13acfbf2112a08dd59414231d6b5267ef215cfe Mon Sep 17 00:00:00 2001 From: aneejit1 Date: Mon, 21 Mar 2022 15:10:55 +0000 Subject: [PATCH 2/9] Build attempts to write to the source directory (#3347) Building with a read-only source directory results in failure due to two attempts to write into the source tree. Amend the CMakeLists.txt files to write the output into the binary directory. --- share/paint/CMakeLists.txt | 8 ++++---- share/palettes/CMakeLists.txt | 8 ++++---- share/symbols/CMakeLists.txt | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/share/paint/CMakeLists.txt b/share/paint/CMakeLists.txt index e139585013..2ddf30854f 100644 --- a/share/paint/CMakeLists.txt +++ b/share/paint/CMakeLists.txt @@ -1,11 +1,11 @@ # SPDX-License-Identifier: GPL-2.0-or-later add_custom_command( - OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/patterns.svg.h - COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/i18n.py ${CMAKE_CURRENT_SOURCE_DIR}/patterns.svg > ${CMAKE_CURRENT_SOURCE_DIR}/patterns.svg.h + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/patterns.svg.h + COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/i18n.py ${CMAKE_CURRENT_SOURCE_DIR}/patterns.svg > ${CMAKE_CURRENT_BINARY_DIR}/patterns.svg.h MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/patterns.svg DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/i18n.py ) -set_source_files_properties(${CMAKE_SOURCE_DIR}/patterns.svg.h PROPERTIES GENERATED TRUE) -add_custom_target(patterns_svg_h ALL DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/patterns.svg.h) +set_source_files_properties(${CMAKE_BINARY_DIR}/patterns.svg.h PROPERTIES GENERATED TRUE) +add_custom_target(patterns_svg_h ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/patterns.svg.h) install(FILES "hatches.svg" "patterns.svg" "README" DESTINATION ${INKSCAPE_SHARE_INSTALL}/paint) diff --git a/share/palettes/CMakeLists.txt b/share/palettes/CMakeLists.txt index dd77633aa2..a1792d3876 100644 --- a/share/palettes/CMakeLists.txt +++ b/share/palettes/CMakeLists.txt @@ -2,14 +2,14 @@ set(I18N_FILES "inkscape.gpl" "svg.gpl" "Tango-Palette.gpl") add_custom_command( - OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/palettes.h - COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/i18n.py ${I18N_FILES} > ${CMAKE_CURRENT_SOURCE_DIR}/palettes.h + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/palettes.h + COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/i18n.py ${I18N_FILES} > ${CMAKE_CURRENT_BINARY_DIR}/palettes.h WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/i18n.py ${I18N_FILES} ) -set_source_files_properties(${CMAKE_SOURCE_DIR}/palettes.h PROPERTIES GENERATED TRUE) +set_source_files_properties(${CMAKE_BINARY_DIR}/palettes.h PROPERTIES GENERATED TRUE) -add_custom_target(palettes_h ALL DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/palettes.h) +add_custom_target(palettes_h ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/palettes.h) file(GLOB _FILES "*.gpl") diff --git a/share/symbols/CMakeLists.txt b/share/symbols/CMakeLists.txt index a3fea408af..a0b9e39efc 100644 --- a/share/symbols/CMakeLists.txt +++ b/share/symbols/CMakeLists.txt @@ -2,12 +2,12 @@ file(GLOB _FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.svg") add_custom_command( - OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/symbols.h - COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/i18n.py ${_FILES} > ${CMAKE_CURRENT_SOURCE_DIR}/symbols.h + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/symbols.h + COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/i18n.py ${_FILES} > ${CMAKE_CURRENT_BINARY_DIR}/symbols.h WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/i18n.py ${_FILES} ) -set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/symbols.h PROPERTIES GENERATED TRUE) -add_custom_target(symbols_h ALL DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/symbols.h) +set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/symbols.h PROPERTIES GENERATED TRUE) +add_custom_target(symbols_h ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/symbols.h) install(FILES ${_FILES} "README" DESTINATION ${INKSCAPE_SHARE_INSTALL}/symbols) -- GitLab From 0cb7b6a75371d0f3e5338259b5f56039be83c478 Mon Sep 17 00:00:00 2001 From: Nathan Lee <2431820-nathanal@users.noreply.gitlab.com> Date: Tue, 1 Mar 2022 22:56:30 +1100 Subject: [PATCH 3/9] Sync cairo with 1.17.6 Alternative fix for broken font name in pdf export. Use cairo version with the fix applied, instead of manually applying fix. Updates patch to apply cleanly onto cairo master (uses 3 way merge). This reverts commit 831e4241b9a31de44a570ce51290f7400eaeb984. --- packaging/{cairo_dither.patch => cairo.patch} | 111 ++++++++---------- packaging/cairo_pdf_valid_font.patch | 58 --------- src/3rdparty/CMakeLists.txt | 4 +- 3 files changed, 51 insertions(+), 122 deletions(-) rename packaging/{cairo_dither.patch => cairo.patch} (86%) delete mode 100644 packaging/cairo_pdf_valid_font.patch diff --git a/packaging/cairo_dither.patch b/packaging/cairo.patch similarity index 86% rename from packaging/cairo_dither.patch rename to packaging/cairo.patch index 59553941a1..dc92e263a3 100644 --- a/packaging/cairo_dither.patch +++ b/packaging/cairo.patch @@ -1,4 +1,4 @@ -From eda28c47b9a70a0f048087685444c6292690f4a1 Mon Sep 17 00:00:00 2001 +From e0d713b9bbd6d4a1e27e18c15141fa7f568001c7 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Wed, 29 May 2019 09:44:09 +0200 Subject: [PATCH 1/3] Enable access to the pixman dithering path Code to choose @@ -10,11 +10,10 @@ Subject: [PATCH 1/3] Enable access to the pixman dithering path Code to choose src/cairo-pattern-private.h | 1 + src/cairo-pattern.c | 45 ++++++++++++++++++++++++++++++++++ src/cairo.h | 14 +++++++++++ - src/drm/cairo-drm-intel.c | 4 +++- - 6 files changed, 114 insertions(+), 2 deletions(-) + 5 files changed, 111 insertions(+), 1 deletion(-) diff --git a/src/cairo-gl-gradient.c b/src/cairo-gl-gradient.c -index 6107bea1e..ad1bcc615 100644 +index 293d4e30e..a22cca729 100644 --- a/src/cairo-gl-gradient.c +++ b/src/cairo-gl-gradient.c @@ -160,7 +160,9 @@ _cairo_gl_gradient_render (const cairo_gl_context_t *ctx, @@ -95,7 +94,7 @@ index c56845ab2..274f43df7 100644 if (pattern->has_component_alpha) pixman_image_set_component_alpha (pixman_image, TRUE); diff --git a/src/cairo-pattern-private.h b/src/cairo-pattern-private.h -index 26d584e68..f6365cc76 100644 +index f6138fb70..96ae4f615 100644 --- a/src/cairo-pattern-private.h +++ b/src/cairo-pattern-private.h @@ -70,6 +70,7 @@ struct _cairo_pattern { @@ -105,9 +104,9 @@ index 26d584e68..f6365cc76 100644 + cairo_dither_t dither; cairo_extend_t extend; cairo_bool_t has_component_alpha; - + cairo_bool_t is_userfont_foreground; diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c -index 32811af59..a216357d3 100644 +index 6bd3edfd8..6cf907f36 100644 --- a/src/cairo-pattern.c +++ b/src/cairo-pattern.c @@ -74,6 +74,7 @@ static const cairo_solid_pattern_t _cairo_pattern_nil = { @@ -117,40 +116,40 @@ index 32811af59..a216357d3 100644 + CAIRO_DITHER_DEFAULT, /* dither */ CAIRO_EXTEND_GRADIENT_DEFAULT, /* extend */ FALSE, /* has component alpha */ - { 1., 0., 0., 1., 0., 0., }, /* matrix */ -@@ -90,6 +91,7 @@ static const cairo_solid_pattern_t _cairo_pattern_nil_null_pointer = { + FALSE, /* is_userfont_foreground */ +@@ -91,6 +92,7 @@ static const cairo_solid_pattern_t _cairo_pattern_nil_null_pointer = { CAIRO_PATTERN_TYPE_SOLID, /* type */ CAIRO_FILTER_DEFAULT, /* filter */ + CAIRO_DITHER_DEFAULT, /* dither */ CAIRO_EXTEND_GRADIENT_DEFAULT, /* extend */ FALSE, /* has component alpha */ - { 1., 0., 0., 1., 0., 0., }, /* matrix */ -@@ -106,6 +108,7 @@ const cairo_solid_pattern_t _cairo_pattern_black = { + FALSE, /* is_userfont_foreground */ +@@ -108,6 +110,7 @@ const cairo_solid_pattern_t _cairo_pattern_black = { CAIRO_PATTERN_TYPE_SOLID, /* type */ CAIRO_FILTER_NEAREST, /* filter */ + CAIRO_DITHER_DEFAULT, /* dither */ CAIRO_EXTEND_REPEAT, /* extend */ FALSE, /* has component alpha */ - { 1., 0., 0., 1., 0., 0., }, /* matrix */ -@@ -123,6 +126,7 @@ const cairo_solid_pattern_t _cairo_pattern_clear = { + FALSE, /* is_userfont_foreground */ +@@ -126,6 +129,7 @@ const cairo_solid_pattern_t _cairo_pattern_clear = { CAIRO_PATTERN_TYPE_SOLID, /* type */ CAIRO_FILTER_NEAREST, /* filter */ + CAIRO_DITHER_DEFAULT, /* dither */ CAIRO_EXTEND_REPEAT, /* extend */ FALSE, /* has component alpha */ - { 1., 0., 0., 1., 0., 0., }, /* matrix */ -@@ -140,6 +144,7 @@ const cairo_solid_pattern_t _cairo_pattern_white = { + FALSE, /* is_userfont_foreground */ +@@ -144,6 +148,7 @@ const cairo_solid_pattern_t _cairo_pattern_white = { CAIRO_PATTERN_TYPE_SOLID, /* type */ CAIRO_FILTER_NEAREST, /* filter */ + CAIRO_DITHER_DEFAULT, /* dither */ CAIRO_EXTEND_REPEAT, /* extend */ FALSE, /* has component alpha */ - { 1., 0., 0., 1., 0., 0., }, /* matrix */ -@@ -230,6 +235,7 @@ _cairo_pattern_init (cairo_pattern_t *pattern, cairo_pattern_type_t type) + FALSE, /* is_userfont_foreground */ +@@ -235,6 +240,7 @@ _cairo_pattern_init (cairo_pattern_t *pattern, cairo_pattern_type_t type) pattern->extend = CAIRO_EXTEND_GRADIENT_DEFAULT; pattern->filter = CAIRO_FILTER_DEFAULT; @@ -158,7 +157,7 @@ index 32811af59..a216357d3 100644 pattern->opacity = 1.0; pattern->has_component_alpha = FALSE; -@@ -2068,6 +2074,28 @@ cairo_pattern_set_filter (cairo_pattern_t *pattern, cairo_filter_t filter) +@@ -2074,6 +2080,28 @@ cairo_pattern_set_filter (cairo_pattern_t *pattern, cairo_filter_t filter) _cairo_pattern_notify_observers (pattern, CAIRO_PATTERN_NOTIFY_FILTER); } @@ -187,7 +186,7 @@ index 32811af59..a216357d3 100644 /** * cairo_pattern_get_filter: * @pattern: a #cairo_pattern_t -@@ -2085,6 +2113,23 @@ cairo_pattern_get_filter (cairo_pattern_t *pattern) +@@ -2091,6 +2119,23 @@ cairo_pattern_get_filter (cairo_pattern_t *pattern) return pattern->filter; } @@ -212,10 +211,10 @@ index 32811af59..a216357d3 100644 * cairo_pattern_set_extend: * @pattern: a #cairo_pattern_t diff --git a/src/cairo.h b/src/cairo.h -index 96427b425..4370df85e 100644 +index fb1da4146..1c911d09d 100644 --- a/src/cairo.h +++ b/src/cairo.h -@@ -2959,12 +2959,26 @@ typedef enum _cairo_filter { +@@ -3003,12 +3003,26 @@ typedef enum _cairo_filter { CAIRO_FILTER_GAUSSIAN } cairo_filter_t; @@ -242,25 +241,11 @@ index 96427b425..4370df85e 100644 cairo_public cairo_status_t cairo_pattern_get_rgba (cairo_pattern_t *pattern, double *red, double *green, -diff --git a/src/drm/cairo-drm-intel.c b/src/drm/cairo-drm-intel.c -index e6fb83dd5..b697b5679 100644 ---- a/src/drm/cairo-drm-intel.c -+++ b/src/drm/cairo-drm-intel.c -@@ -1288,7 +1288,9 @@ intel_gradient_render (intel_device_t *device, - - pixman_image_set_filter (gradient, PIXMAN_FILTER_BILINEAR, NULL, 0); - pixman_image_set_repeat (gradient, PIXMAN_REPEAT_PAD); -- -+#if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0,39,0) -+ pixman_image_set_dither (gradient, PIXMAN_DITHER_BEST); -+#endif - image = pixman_image_create_bits (PIXMAN_a8r8g8b8, width, 1, NULL, 0); - if (unlikely (image == NULL)) { - pixman_image_unref (gradient); -- -2.34.1 +2.25.1 -From 62a1016e475f54705fd275ee24d6056b1649afcc Mon Sep 17 00:00:00 2001 + +From 659173b4bb01e2de438d894dca9ed01838eaf028 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Sat, 27 Mar 2021 23:53:28 +0100 Subject: [PATCH 2/3] Expose dithering property at the image surface level. @@ -276,7 +261,7 @@ Copies the property on push_group 6 files changed, 96 insertions(+), 45 deletions(-) diff --git a/src/cairo-default-context.c b/src/cairo-default-context.c -index 95b5f6b77..b5a531aa1 100644 +index 567c5d4d5..24af125da 100644 --- a/src/cairo-default-context.c +++ b/src/cairo-default-context.c @@ -180,7 +180,11 @@ _cairo_default_context_push_group (void *abstract_cr, cairo_content_t content) @@ -363,7 +348,7 @@ index 2b7921133..c06b9737b 100644 #define to_image_surface(S) ((cairo_image_surface_t *)(S)) diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c -index 0e17f3a16..7478647bc 100644 +index 3b11eb981..977bb48e6 100644 --- a/src/cairo-image-surface.c +++ b/src/cairo-image-surface.c @@ -169,6 +169,7 @@ _cairo_image_surface_init (cairo_image_surface_t *surface, @@ -439,7 +424,7 @@ index 0e17f3a16..7478647bc 100644 clone->owns_data = TRUE; return &clone->base; -@@ -1358,3 +1403,25 @@ error: +@@ -1361,3 +1406,25 @@ error: cairo_surface_destroy (image); return to_image_surface (_cairo_surface_create_in_error (status)); } @@ -466,7 +451,7 @@ index 0e17f3a16..7478647bc 100644 +//slim_hidden_def (cairo_image_surface_set_dither); + diff --git a/src/cairo.h b/src/cairo.h -index 4370df85e..f50e78cce 100644 +index 1c911d09d..76db87d2e 100644 --- a/src/cairo.h +++ b/src/cairo.h @@ -427,6 +427,14 @@ typedef enum _cairo_format { @@ -484,7 +469,7 @@ index 4370df85e..f50e78cce 100644 /** * cairo_write_func_t: -@@ -2563,6 +2571,12 @@ cairo_image_surface_create_for_data (unsigned char *data, +@@ -2607,6 +2615,12 @@ cairo_image_surface_create_for_data (unsigned char *data, cairo_public unsigned char * cairo_image_surface_get_data (cairo_surface_t *surface); @@ -497,7 +482,7 @@ index 4370df85e..f50e78cce 100644 cairo_public cairo_format_t cairo_image_surface_get_format (cairo_surface_t *surface); -@@ -2959,14 +2973,6 @@ typedef enum _cairo_filter { +@@ -3003,14 +3017,6 @@ typedef enum _cairo_filter { CAIRO_FILTER_GAUSSIAN } cairo_filter_t; @@ -513,10 +498,10 @@ index 4370df85e..f50e78cce 100644 cairo_pattern_set_filter (cairo_pattern_t *pattern, cairo_filter_t filter); diff --git a/src/cairoint.h b/src/cairoint.h -index 7c1000556..0df148feb 100644 +index 80b695feb..a8442b5fe 100644 --- a/src/cairoint.h +++ b/src/cairoint.h -@@ -1582,6 +1582,11 @@ cairo_private cairo_bool_t +@@ -1592,6 +1592,11 @@ cairo_private cairo_bool_t _pixman_format_to_masks (pixman_format_code_t pixman_format, cairo_format_masks_t *masks); @@ -529,9 +514,10 @@ index 7c1000556..0df148feb 100644 _cairo_image_scaled_glyph_fini (cairo_scaled_font_t *scaled_font, cairo_scaled_glyph_t *scaled_glyph); -- -2.34.1 +2.25.1 + -From 1e5537ec948ce4b52acd46fce785be11725a551f Mon Sep 17 00:00:00 2001 +From edf60824e871d2393136303761135bb49986fa33 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Mon, 29 Mar 2021 12:18:56 +0200 Subject: [PATCH 3/3] make lint tests pass @@ -543,7 +529,7 @@ Subject: [PATCH 3/3] make lint tests pass 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c -index 7478647bc..d8d91d8e1 100644 +index 977bb48e6..d2f544a68 100644 --- a/src/cairo-image-surface.c +++ b/src/cairo-image-surface.c @@ -250,8 +250,9 @@ _pixman_format_from_masks (cairo_format_masks_t *masks, @@ -576,7 +562,7 @@ index 7478647bc..d8d91d8e1 100644 /** * cairo_image_surface_get_height: -@@ -1404,6 +1405,15 @@ error: +@@ -1407,6 +1408,15 @@ error: return to_image_surface (_cairo_surface_create_in_error (status)); } @@ -592,7 +578,7 @@ index 7478647bc..d8d91d8e1 100644 cairo_public int cairo_image_surface_set_dither (cairo_surface_t *surface, cairo_dither_t dither) { -@@ -1423,5 +1433,5 @@ cairo_image_surface_set_dither (cairo_surface_t *surface, cairo_dither_t dither) +@@ -1426,5 +1436,5 @@ cairo_image_surface_set_dither (cairo_surface_t *surface, cairo_dither_t dither) } } @@ -600,10 +586,10 @@ index 7478647bc..d8d91d8e1 100644 +slim_hidden_def (cairo_image_surface_set_dither); diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c -index a216357d3..f07ab9f83 100644 +index 6cf907f36..7d05b06a1 100644 --- a/src/cairo-pattern.c +++ b/src/cairo-pattern.c -@@ -2081,7 +2081,7 @@ cairo_pattern_set_filter (cairo_pattern_t *pattern, cairo_filter_t filter) +@@ -2087,7 +2087,7 @@ cairo_pattern_set_filter (cairo_pattern_t *pattern, cairo_filter_t filter) * * See #cairo_dither_t for details on each algorithm. * @@ -612,7 +598,7 @@ index a216357d3..f07ab9f83 100644 **/ void cairo_pattern_set_dither (cairo_pattern_t *pattern, cairo_dither_t dither) -@@ -2122,7 +2122,7 @@ cairo_pattern_get_filter (cairo_pattern_t *pattern) +@@ -2128,7 +2128,7 @@ cairo_pattern_get_filter (cairo_pattern_t *pattern) * * Return value: the current dithering algorithm of the pattern * @@ -622,10 +608,10 @@ index a216357d3..f07ab9f83 100644 cairo_dither_t cairo_pattern_get_dither (cairo_pattern_t *pattern) diff --git a/src/cairoint.h b/src/cairoint.h -index 0df148feb..e78ba80cc 100644 +index a8442b5fe..274d43556 100644 --- a/src/cairoint.h +++ b/src/cairoint.h -@@ -1584,7 +1584,7 @@ _pixman_format_to_masks (pixman_format_code_t pixman_format, +@@ -1594,7 +1594,7 @@ _pixman_format_to_masks (pixman_format_code_t pixman_format, #if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0,39,0) cairo_private pixman_dither_t @@ -634,7 +620,7 @@ index 0df148feb..e78ba80cc 100644 #endif cairo_private void -@@ -1978,6 +1978,8 @@ slim_hidden_proto (cairo_image_surface_get_format); +@@ -1982,6 +1982,8 @@ slim_hidden_proto (cairo_image_surface_get_format); slim_hidden_proto (cairo_image_surface_get_height); slim_hidden_proto (cairo_image_surface_get_stride); slim_hidden_proto (cairo_image_surface_get_width); @@ -644,9 +630,10 @@ index 0df148feb..e78ba80cc 100644 slim_hidden_proto (cairo_mask); slim_hidden_proto (cairo_matrix_init); -- -2.34.1 +2.25.1 + -From 8522e26a7fe32d0098650eb8e778dc19ff778d23 Mon Sep 17 00:00:00 2001 +From b2e0f1d6f69ad3013dfb8d677f7b3ee9fac0fceb Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Mon, 24 Jan 2022 21:28:44 +0100 Subject: [PATCH] add define to detect patched cairo @@ -656,10 +643,10 @@ Subject: [PATCH] add define to detect patched cairo 1 file changed, 1 insertion(+) diff --git a/src/cairo.h b/src/cairo.h -index f50e78cce..47360bbd4 100644 +index 76db87d2e..934bf65d0 100644 --- a/src/cairo.h +++ b/src/cairo.h -@@ -2571,6 +2571,7 @@ cairo_image_surface_create_for_data (unsigned char *data, +@@ -2615,6 +2615,7 @@ cairo_image_surface_create_for_data (unsigned char *data, cairo_public unsigned char * cairo_image_surface_get_data (cairo_surface_t *surface); @@ -668,5 +655,5 @@ index f50e78cce..47360bbd4 100644 cairo_image_surface_get_dither (cairo_surface_t *surface); -- -2.34.1 +2.25.1 diff --git a/packaging/cairo_pdf_valid_font.patch b/packaging/cairo_pdf_valid_font.patch deleted file mode 100644 index e07e7fb71d..0000000000 --- a/packaging/cairo_pdf_valid_font.patch +++ /dev/null @@ -1,58 +0,0 @@ -From a3b69a0215fdface0fd5730872a4b3242d979dca Mon Sep 17 00:00:00 2001 -From: Uli Schlachter -Date: Tue, 9 Feb 2021 16:54:35 +0100 -Subject: [PATCH] pdf font subset: Generate valid font names - -A hash value is encoded in base 26 with upper case letters for font -names. - -Commit ed984146 replaced "numerator = abs (hash);" with "numerator = -hash;" in this code, because hash has type uint32_t and the compiler -warned about taking the absolute value of an unsigned value. However, -abs() is actually defined to take an int argument. Thus, there was some -implicit cast. - -Since numerator has type long, i.e. is signed, it is now actually -possible to get an overflow in the implicit cast and then have a -negative number. The following code is not prepared for this and -produces non-letters when encoding the hash. - -This commit fixes that problem by not using ldiv() and instead using / -and % to directly compute the needed values. This gets rid of the need -to convert to type long. Since now everything works with uint32_t, there -is no more chance for negative numbers messing things up. - -Fixes: https://gitlab.freedesktop.org/cairo/cairo/-/issues/449 -Signed-off-by: Uli Schlachter ---- - src/cairo-pdf-surface.c | 8 ++------ - 1 file changed, 2 insertions(+), 6 deletions(-) - -diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c -index 6da460878..52c49b6d2 100644 ---- a/src/cairo-pdf-surface.c -+++ b/src/cairo-pdf-surface.c -@@ -5310,18 +5310,14 @@ _create_font_subset_tag (cairo_scaled_font_subset_t *font_subset, - { - uint32_t hash; - int i; -- long numerator; -- ldiv_t d; - - hash = _hash_data ((unsigned char *) font_name, strlen(font_name), 0); - hash = _hash_data ((unsigned char *) (font_subset->glyphs), - font_subset->num_glyphs * sizeof(unsigned long), hash); - -- numerator = hash; - for (i = 0; i < 6; i++) { -- d = ldiv (numerator, 26); -- numerator = d.quot; -- tag[i] = 'A' + d.rem; -+ tag[i] = 'A' + (hash % 26); -+ hash /= 26; - } - tag[i] = 0; - } --- -2.25.1 - diff --git a/src/3rdparty/CMakeLists.txt b/src/3rdparty/CMakeLists.txt index b20b9dcb82..2f94cf56eb 100644 --- a/src/3rdparty/CMakeLists.txt +++ b/src/3rdparty/CMakeLists.txt @@ -23,10 +23,10 @@ if(WITH_INTERNAL_CAIRO) ExternalProject_Add(cairo_ext PREFIX cairo GIT_REPOSITORY https://gitlab.freedesktop.org/cairo/cairo.git - GIT_TAG 1.17.4 + GIT_TAG 1.17.6 GIT_SHALLOW TRUE SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/cairo - PATCH_COMMAND git checkout ${CMAKE_CURRENT_SOURCE_DIR}/cairo/src && git apply --unsafe-paths --directory ${CMAKE_CURRENT_SOURCE_DIR}/cairo/ ${CMAKE_SOURCE_DIR}/packaging/cairo_dither.patch ${CMAKE_SOURCE_DIR}/packaging/cairo_pdf_valid_font.patch + PATCH_COMMAND git checkout ${CMAKE_CURRENT_SOURCE_DIR}/cairo/src && git apply --unsafe-paths --directory ${CMAKE_CURRENT_SOURCE_DIR}/cairo/ ${CMAKE_SOURCE_DIR}/packaging/cairo.patch BUILD_COMMAND make -j16 CONFIGURE_COMMAND ${CAIRO_CONF} ) -- GitLab From 7676fa2d010fdccd042b9dd1a324c6b7c14d0d51 Mon Sep 17 00:00:00 2001 From: Nathan Lee <2431820-nathanal@users.noreply.gitlab.com> Date: Thu, 17 Mar 2022 14:04:57 +1100 Subject: [PATCH 4/9] Fix Spray tool no color overlap if used alone Also correct usage with y-axis pointing up. https://gitlab.com/inkscape/inkscape/-/issues/3338 --- src/ui/tools/spray-tool.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/ui/tools/spray-tool.cpp b/src/ui/tools/spray-tool.cpp index 837c82bff6..705b12977e 100644 --- a/src/ui/tools/spray-tool.cpp +++ b/src/ui/tools/spray-tool.cpp @@ -511,6 +511,7 @@ static bool fit_item(SPDesktop *desktop, sp_spray_transform_path(item, path, Geom::Scale(scale), center); sp_spray_transform_path(item, path, Geom::Rotate(angle), center); path *= Geom::Translate(move); + path *= desktop->doc2dt(); bbox_procesed = path.boundsFast(); double bbox_left_main = bbox_procesed->left(); double bbox_right_main = bbox_procesed->right(); @@ -518,7 +519,7 @@ static bool fit_item(SPDesktop *desktop, double bbox_bottom_main = bbox_procesed->bottom(); double width_transformed = bbox_procesed->width(); double height_transformed = bbox_procesed->height(); - Geom::Point mid_point = desktop->d2w(bbox_procesed->midpoint() * desktop->doc2dt()); + Geom::Point mid_point = desktop->d2w(bbox_procesed->midpoint()); Geom::IntRect area = Geom::IntRect::from_xywh(floor(mid_point[Geom::X]), floor(mid_point[Geom::Y]), 1, 1); guint32 rgba = getPickerData(area, desktop); guint32 rgba2 = 0xffffff00; @@ -907,7 +908,9 @@ static bool sp_spray_recursive(SPDesktop *desktop, Geom::Point center = item->getCenter(); Geom::Point move = (Geom::Point(cos(tilt)*cos(dp)*dr/(1-ratio)+sin(tilt)*sin(dp)*dr/(1+ratio), -sin(tilt)*cos(dp)*dr/(1-ratio)+cos(tilt)*sin(dp)*dr/(1+ratio)))+(p-a->midpoint()); SPCSSAttr *css = sp_repr_css_attr_new(); - if(mode == SPRAY_MODE_ERASER || no_overlap || picker || !over_transparent || !over_no_transparent){ + if (mode == SPRAY_MODE_ERASER || + pick_no_overlap || no_overlap || picker || + !over_transparent || !over_no_transparent) { if(!fit_item(desktop , item , a @@ -1036,7 +1039,9 @@ static bool sp_spray_recursive(SPDesktop *desktop, Geom::Point center=item->getCenter(); Geom::Point move = (Geom::Point(cos(tilt)*cos(dp)*dr/(1-ratio)+sin(tilt)*sin(dp)*dr/(1+ratio), -sin(tilt)*cos(dp)*dr/(1-ratio)+cos(tilt)*sin(dp)*dr/(1+ratio)))+(p-a->midpoint()); SPCSSAttr *css = sp_repr_css_attr_new(); - if(mode == SPRAY_MODE_ERASER || no_overlap || picker || !over_transparent || !over_no_transparent){ + if (mode == SPRAY_MODE_ERASER || + pick_no_overlap || no_overlap || picker || + !over_transparent || !over_no_transparent) { if(!fit_item(desktop , item , a -- GitLab From 6294ca04f9f17e4e7561141c3ced0bd6064a7993 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Fri, 18 Mar 2022 14:36:26 -0400 Subject: [PATCH 5/9] Select correct context for marker context-fill and stroke The context object when populating the context-fill and context-stroke was always set to be the first href the marker had seen in pdf export. Instead we need to track the parent object and the clone context so that we can make use of them. We also need to prevent poluting the paint origin after using the marker's style structure. One other fix included is an Gtk-CRITICAL in the unrefHref caused by the order of the checks being the same as the refHref.wq Fixes https://gitlab.com/inkscape/inkscape/-/issues/2545 --- src/extension/internal/cairo-renderer.cpp | 44 ++++++++++++++--------- src/extension/internal/cairo-renderer.h | 2 +- src/object/sp-object.cpp | 4 +-- 3 files changed, 30 insertions(+), 20 deletions(-) diff --git a/src/extension/internal/cairo-renderer.cpp b/src/extension/internal/cairo-renderer.cpp index 1201bb7264..7cf826f51f 100644 --- a/src/extension/internal/cairo-renderer.cpp +++ b/src/extension/internal/cairo-renderer.cpp @@ -137,18 +137,18 @@ Here comes the rendering part which could be put into the 'render' methods of SP */ /* The below functions are copy&pasted plus slightly modified from *_invoke_print functions. */ -static void sp_item_invoke_render(SPItem *item, CairoRenderContext *ctx); +static void sp_item_invoke_render(SPItem *item, CairoRenderContext *ctx, SPItem *origin = nullptr); static void sp_group_render(SPGroup *group, CairoRenderContext *ctx); static void sp_anchor_render(SPAnchor *a, CairoRenderContext *ctx); static void sp_use_render(SPUse *use, CairoRenderContext *ctx); -static void sp_shape_render(SPShape *shape, CairoRenderContext *ctx); +static void sp_shape_render(SPShape *shape, CairoRenderContext *ctx, SPItem *origin = nullptr); static void sp_text_render(SPText *text, CairoRenderContext *ctx); static void sp_flowtext_render(SPFlowtext *flowtext, CairoRenderContext *ctx); static void sp_image_render(SPImage *image, CairoRenderContext *ctx); static void sp_symbol_render(SPSymbol *symbol, CairoRenderContext *ctx); static void sp_asbitmap_render(SPItem *item, CairoRenderContext *ctx); -static void sp_shape_render_invoke_marker_rendering(SPMarker* marker, Geom::Affine tr, SPStyle* style, CairoRenderContext *ctx) +static void sp_shape_render_invoke_marker_rendering(SPMarker* marker, Geom::Affine tr, SPStyle* style, CairoRenderContext *ctx, SPItem *origin) { bool render = true; if (marker->markerUnits == SP_MARKER_UNITS_STROKEWIDTH) { @@ -165,13 +165,13 @@ static void sp_shape_render_invoke_marker_rendering(SPMarker* marker, Geom::Affi tr = (Geom::Affine)marker_item->transform * (Geom::Affine)marker->c2p * tr; Geom::Affine old_tr = marker_item->transform; marker_item->transform = tr; - ctx->getRenderer()->renderItem (ctx, marker_item); + ctx->getRenderer()->renderItem (ctx, marker_item, origin); marker_item->transform = old_tr; } } } -static void sp_shape_render(SPShape *shape, CairoRenderContext *ctx) +static void sp_shape_render(SPShape *shape, CairoRenderContext *ctx, SPItem *origin) { if (!shape->curve()) { return; @@ -180,6 +180,8 @@ static void sp_shape_render(SPShape *shape, CairoRenderContext *ctx) Geom::OptRect pbox = shape->geometricBounds(); SPStyle* style = shape->style; + auto fill_origin = style->fill.paintOrigin; + auto stroke_origin = style->stroke.paintOrigin; SPObject *defs = dynamic_cast(shape->document->getDefs()); if (defs && defs->isAncestorOf(shape)) { @@ -189,9 +191,10 @@ static void sp_shape_render(SPShape *shape, CairoRenderContext *ctx) parentobj = dynamic_cast(parentobj->parent); marker = dynamic_cast(parentobj); } - SPObject *origin = nullptr; if (marker) { - origin = (*marker->hrefList.begin()); + // Origin will ultimately be either the original object the marker + // was added to OR a use tag. See sp_use_render for where this object + // comes from when it's a clone. if (origin) { SPStyle* styleorig = origin->style; bool iscolorfill = styleorig->fill.isColor() || (styleorig->fill.isPaintserver() && !styleorig->getFillPaintServer()->isValid()); @@ -200,6 +203,7 @@ static void sp_shape_render(SPShape *shape, CairoRenderContext *ctx) bool fillctxstroke = style->fill.paintOrigin == SP_CSS_PAINT_ORIGIN_CONTEXT_STROKE; bool strokectxfill = style->stroke.paintOrigin == SP_CSS_PAINT_ORIGIN_CONTEXT_FILL; bool strokectxstroke = style->stroke.paintOrigin == SP_CSS_PAINT_ORIGIN_CONTEXT_STROKE; + if (fillctxfill || fillctxstroke) { if (fillctxfill ? iscolorfill : iscolorstroke) { style->fill.setColor(fillctxfill ? styleorig->fill.value.color : styleorig->stroke.value.color); @@ -256,7 +260,7 @@ static void sp_shape_render(SPShape *shape, CairoRenderContext *ctx) } else { tr = Geom::Rotate::from_degrees(marker->orient.computed) * Geom::Translate(pathv.begin()->front().pointAt(0)); } - sp_shape_render_invoke_marker_rendering(marker, tr, style, ctx); + sp_shape_render_invoke_marker_rendering(marker, tr, style, ctx, origin ? origin : shape); } } // MID marker @@ -274,7 +278,7 @@ static void sp_shape_render(SPShape *shape, CairoRenderContext *ctx) } else { tr = Geom::Rotate::from_degrees(marker->orient.computed) * Geom::Translate(path_it->front().pointAt(0)); } - sp_shape_render_invoke_marker_rendering(marker, tr, style, ctx); + sp_shape_render_invoke_marker_rendering(marker, tr, style, ctx, origin ? origin : shape); } // MID position if (path_it->size_default() > 1) { @@ -292,7 +296,7 @@ static void sp_shape_render(SPShape *shape, CairoRenderContext *ctx) tr = Geom::Rotate::from_degrees(marker->orient.computed) * Geom::Translate(curve_it1->pointAt(1)); } - sp_shape_render_invoke_marker_rendering(marker, tr, style, ctx); + sp_shape_render_invoke_marker_rendering(marker, tr, style, ctx, origin ? origin : shape); ++curve_it1; ++curve_it2; @@ -307,7 +311,7 @@ static void sp_shape_render(SPShape *shape, CairoRenderContext *ctx) } else { tr = Geom::Rotate::from_degrees(marker->orient.computed) * Geom::Translate(lastcurve.pointAt(1)); } - sp_shape_render_invoke_marker_rendering(marker, tr, style, ctx); + sp_shape_render_invoke_marker_rendering(marker, tr, style, ctx, origin ? origin : shape); } } } @@ -332,7 +336,7 @@ static void sp_shape_render(SPShape *shape, CairoRenderContext *ctx) tr = Geom::Rotate::from_degrees(marker->orient.computed) * Geom::Translate(lastcurve.pointAt(1)); } - sp_shape_render_invoke_marker_rendering(marker, tr, style, ctx); + sp_shape_render_invoke_marker_rendering(marker, tr, style, ctx, origin ? origin : shape); } } @@ -350,6 +354,10 @@ static void sp_shape_render(SPShape *shape, CairoRenderContext *ctx) ctx->renderPathVector(pathv, style, pbox, CairoRenderContext::FILL_ONLY); } + // Put the style's paint origin back, in case this shape is a marker + // which is rendered multple times. + style->fill.paintOrigin = fill_origin; + style->stroke.paintOrigin = stroke_origin; } static void sp_group_render(SPGroup *group, CairoRenderContext *ctx) @@ -378,7 +386,9 @@ static void sp_use_render(SPUse *use, CairoRenderContext *ctx) } if (use->child) { - renderer->renderItem(ctx, use->child); + // Padding in the use object as the origin here ensures markers + // are rendered with their correct context-fill. + renderer->renderItem(ctx, use->child, use); } if (translated) { @@ -581,7 +591,7 @@ static void sp_asbitmap_render(SPItem *item, CairoRenderContext *ctx) } -static void sp_item_invoke_render(SPItem *item, CairoRenderContext *ctx) +static void sp_item_invoke_render(SPItem *item, CairoRenderContext *ctx, SPItem *origin) { // Check item's visibility if (item->isHidden()) { @@ -621,7 +631,7 @@ static void sp_item_invoke_render(SPItem *item, CairoRenderContext *ctx) SPShape *shape = dynamic_cast(item); if (shape) { TRACE(("shape\n")); - sp_shape_render(shape, ctx); + sp_shape_render(shape, ctx, origin); } else { SPUse *use = dynamic_cast(item); if (use) { @@ -681,7 +691,7 @@ CairoRenderer::setStateForItem(CairoRenderContext *ctx, SPItem const *item) } // TODO change this to accept a const SPItem: -void CairoRenderer::renderItem(CairoRenderContext *ctx, SPItem *item) +void CairoRenderer::renderItem(CairoRenderContext *ctx, SPItem *item, SPItem *origin) { ctx->pushState(); setStateForItem(ctx, item); @@ -701,7 +711,7 @@ void CairoRenderer::renderItem(CairoRenderContext *ctx, SPItem *item) ctx->pushLayer(); } ctx->transform(item->transform); - sp_item_invoke_render(item, ctx); + sp_item_invoke_render(item, ctx, origin); if (state->need_layer) { if (blend) { diff --git a/src/extension/internal/cairo-renderer.h b/src/extension/internal/cairo-renderer.h index cac01aba2b..258df7fb24 100644 --- a/src/extension/internal/cairo-renderer.h +++ b/src/extension/internal/cairo-renderer.h @@ -53,7 +53,7 @@ public: bool setupDocument(CairoRenderContext *ctx, SPDocument *doc, bool pageBoundingBox, double bleedmargin_px, SPItem *base); /** Traverses the object tree and invokes the render methods. */ - void renderItem(CairoRenderContext *ctx, SPItem *item); + void renderItem(CairoRenderContext *ctx, SPItem *item, SPItem *clone = nullptr); void renderHatchPath(CairoRenderContext *ctx, SPHatchPath const &hatchPath, unsigned key); private: diff --git a/src/object/sp-object.cpp b/src/object/sp-object.cpp index 0e462ba5d9..db6c7bd28d 100644 --- a/src/object/sp-object.cpp +++ b/src/object/sp-object.cpp @@ -304,9 +304,9 @@ void SPObject::hrefObject(SPObject* owner) void SPObject::unhrefObject(SPObject* owner) { - g_return_if_fail(hrefcount > 0); - if (!owner || !owner->cloned) { + g_return_if_fail(hrefcount > 0); + hrefcount--; _updateTotalHRefCount(-1); } -- GitLab From c7be4e66cf741acae05b232340f41a9b853124ca Mon Sep 17 00:00:00 2001 From: Maren Hachmann <934908-Moini@users.noreply.gitlab.com> Date: Tue, 22 Mar 2022 20:36:36 +0000 Subject: [PATCH 6/9] Fix typo --- share/ui/align-and-distribute.ui | 42 ++++++++++++++++---------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/share/ui/align-and-distribute.ui b/share/ui/align-and-distribute.ui index d5ccb949e6..bb5ccf0429 100644 --- a/share/ui/align-and-distribute.ui +++ b/share/ui/align-and-distribute.ui @@ -333,7 +333,7 @@ image-align-on-canvas none True - Enable on-canvas alignment handles. + Enable on-canvas alignment handles app.object-align-on-canvas @@ -349,7 +349,7 @@ image-align-sel-as-group none True - Treat selection as group. + Treat selection as group 0 @@ -361,7 +361,7 @@ True False 4 - Alignment handles with third click. + Alignment handles with third click 0 @@ -374,7 +374,7 @@ True False 4 - Move/align selection as group. + Move/align selection as group 0 @@ -446,7 +446,7 @@ image-align-horizontal-right-to-anchor none True - Align right edges of objects to the left edge of anchor. + Align right edges of objects to the left edge of anchor 0 @@ -461,7 +461,7 @@ image-align-horizontal-left none True - Align left edges. + Align left edges 1 @@ -476,7 +476,7 @@ image-align-horizontal-center none True - Center of vertical axis. + Center on vertical axis 2 @@ -491,7 +491,7 @@ image-align-horizontal-right none True - Align right edges. + Align right edges 3 @@ -506,7 +506,7 @@ image-align-horizontal-left-to-anchor none True - Align left edges of objects to the right edge of anchor. + Align left edges of objects to the right edge of anchor 4 @@ -521,7 +521,7 @@ image-align-horizontal-baseline none True - Align baseline anchors of texts horizontally. + Align baseline anchors of texts horizontally 5 @@ -536,7 +536,7 @@ image-align-vertical-bottom-to-anchor none True - Align bottom edges of objects to the top edge of anchor. + Align bottom edges of objects to the top edge of anchor 0 @@ -551,7 +551,7 @@ image-align-vertical-top none True - Align top edges. + Align top edges 1 @@ -566,7 +566,7 @@ image-align-vertical-center none True - Center on horizontal axis. + Center on horizontal axis 2 @@ -581,7 +581,7 @@ image-align-vertical-bottom none True - Align bottom edges. + Align bottom edges 3 @@ -596,7 +596,7 @@ image-align-vertical-top-to-anchor none True - Align top edges of objects to bottom edge of anchor. + Align top edges of objects to bottom edge of anchor 4 @@ -611,7 +611,7 @@ image-align-vertical-baseline none True - Align baselines of texts. + Align baselines of texts 5 @@ -1015,7 +1015,7 @@ number RemoveOverlap_HGap True - Mininum horizontal gap (in pixel units) between bounding boxes. + Minimum horizontal gap (in pixel units) between bounding boxes False @@ -1043,7 +1043,7 @@ number RemoveOverlap_VGap True - Mininum vertical gap (in pixel units) between bounding boxes. + Mininum vertical gap (in pixel units) between bounding boxes False @@ -1060,7 +1060,7 @@ image-distribute-remove-overlaps none True - Move objects as little as possible so that their bounding boxes do not overlap. + Move objects as little as possible so that their bounding boxes do not overlap False @@ -1177,7 +1177,7 @@ image-align-vertical-node none True - Align selected nodes to a common horizontal line. + Align selected nodes to a common horizontal line 0 @@ -1192,7 +1192,7 @@ image-align-horizontal-node none True - Align selected nodes to a common vertical line. + Align selected nodes to a common vertical line 1 -- GitLab From 6c04ea2439d5b146113266954beafe53de8d33b8 Mon Sep 17 00:00:00 2001 From: Rafael Siejakowski Date: Fri, 18 Mar 2022 18:50:27 -0300 Subject: [PATCH 7/9] Prevent clumping of x/y/w/h changes in undo history Consecutive adjustments of x position via the spinbutton in the Select Tool's toolbar are only clumped into a single event in the undo history if they apply to the same selection. Whenever the selection is changed, the subsequent adjustments will constitute a new event in the history. The same applies to y position, width and height. Fixes https://gitlab.com/inkscape/inkscape/-/issues/3217 --- src/ui/toolbar/select-toolbar.cpp | 35 +++++++++++++++++++++---------- src/ui/toolbar/select-toolbar.h | 4 ++++ 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/src/ui/toolbar/select-toolbar.cpp b/src/ui/toolbar/select-toolbar.cpp index f086f77bce..528b8858ed 100644 --- a/src/ui/toolbar/select-toolbar.cpp +++ b/src/ui/toolbar/select-toolbar.cpp @@ -54,13 +54,14 @@ namespace Toolbar { SelectToolbar::SelectToolbar(SPDesktop *desktop) : Toolbar(desktop), _tracker(new UnitTracker(Inkscape::Util::UNIT_TYPE_LINEAR)), - _update(false), _lock_btn(Gtk::manage(new Gtk::ToggleToolButton())), _select_touch_btn(Gtk::manage(new Gtk::ToggleToolButton())), _transform_stroke_btn(Gtk::manage(new Gtk::ToggleToolButton())), _transform_corners_btn(Gtk::manage(new Gtk::ToggleToolButton())), _transform_gradient_btn(Gtk::manage(new Gtk::ToggleToolButton())), - _transform_pattern_btn(Gtk::manage(new Gtk::ToggleToolButton())) + _transform_pattern_btn(Gtk::manage(new Gtk::ToggleToolButton())), + _update(false), + _action_prefix("selector:toolbar:") { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); @@ -418,15 +419,7 @@ SelectToolbar::any_value_changed(Glib::RefPtr& adj) sv = Quantity::convert(sv, "px", unit); } - // do the action only if one of the scales/moves is greater than half the last significant - // digit in the spinbox (currently spinboxes have 3 fractional digits, so that makes 0.0005). If - // the value was changed by the user, the difference will be at least that much; otherwise it's - // just rounding difference between the spinbox value and actual value, so no action is - // performed - char const * const actionkey = ( mh > 5e-4 ? "selector:toolbar:move:horizontal" : - sh > 5e-4 ? "selector:toolbar:scale:horizontal" : - mv > 5e-4 ? "selector:toolbar:move:vertical" : - sv > 5e-4 ? "selector:toolbar:scale:vertical" : nullptr ); + char const *const actionkey = get_action_key(mh, sh, mv, sv); if (actionkey != nullptr) { @@ -521,7 +514,27 @@ SelectToolbar::on_inkscape_selection_changed(Inkscape::Selection *selection) } layout_widget_update(selection); + _selection_seq++; + } +} + +char const *SelectToolbar::get_action_key(double mh, double sh, double mv, double sv) +{ + // do the action only if one of the scales/moves is greater than half the last significant + // digit in the spinbox (currently spinboxes have 3 fractional digits, so that makes 0.0005). If + // the value was changed by the user, the difference will be at least that much; otherwise it's + // just rounding difference between the spinbox value and actual value, so no action is + // performed + double const threshold = 5e-4; + char const *const action = ( mh > threshold ? "move:horizontal:" : + sh > threshold ? "scale:horizontal:" : + mv > threshold ? "move:vertical:" : + sv > threshold ? "scale:vertical:" : nullptr ); + if (!action) { + return nullptr; } + _action_key = _action_prefix + action + std::to_string(_selection_seq); + return _action_key.c_str(); } void diff --git a/src/ui/toolbar/select-toolbar.h b/src/ui/toolbar/select-toolbar.h index 9e05fe73e8..3d8a2d6576 100644 --- a/src/ui/toolbar/select-toolbar.h +++ b/src/ui/toolbar/select-toolbar.h @@ -52,7 +52,11 @@ private: std::vector _connections; bool _update; + std::uint64_t _selection_seq = 0; ///< Increment to prevent coalescing of consecutive undo events + std::string _action_key; + std::string const _action_prefix; + char const *get_action_key(double mh, double sh, double mv, double sv); void any_value_changed(Glib::RefPtr& adj); void layout_widget_update(Inkscape::Selection *sel); void on_inkscape_selection_modified(Inkscape::Selection *selection, guint flags); -- GitLab From ec20054d99fa3f41e4f4630a3d3621286034ad6a Mon Sep 17 00:00:00 2001 From: aneejit1 Date: Wed, 23 Mar 2022 12:45:30 +0000 Subject: [PATCH 8/9] Correct comment typo --- po/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt index 661c9cfc82..ccaf5d33bd 100644 --- a/po/CMakeLists.txt +++ b/po/CMakeLists.txt @@ -21,7 +21,7 @@ set(_potFile ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}.pot) set(_potFiles_src ${CMAKE_CURRENT_BINARY_DIR}/POTFILES.src) set(xgettext_options -cTRANSLATORS -j --keyword=_ --keyword=N_ --keyword=Q_:1g --keyword=C_:1c,2 --keyword=NC_:1c,2 --msgid-bugs-address=inkscape-translator@lists.inkscape.org --from-code=UTF-8 -ktranslatable -o ${_potFile}) -# configure the POTFILES.src file from POTSFILE.src.in +# configure the POTFILES.src file from POTFILES.src.in configure_file(POTFILES.src.in ${_potFiles_src}) # Due to a bug in old xgettext versions, we cannot use '--its='. -- GitLab From 15be23d7e341dec87590939042e77d7762518258 Mon Sep 17 00:00:00 2001 From: aneejit1 Date: Wed, 23 Mar 2022 19:22:46 +0000 Subject: [PATCH 9/9] Build attempts to write to the source directory (#3347) --- po/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt index ccaf5d33bd..941a65497e 100644 --- a/po/CMakeLists.txt +++ b/po/CMakeLists.txt @@ -17,7 +17,7 @@ endforeach(language) # update inkscape.pot -set(_potFile ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}.pot) +set(_potFile ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.pot) set(_potFiles_src ${CMAKE_CURRENT_BINARY_DIR}/POTFILES.src) set(xgettext_options -cTRANSLATORS -j --keyword=_ --keyword=N_ --keyword=Q_:1g --keyword=C_:1c,2 --keyword=NC_:1c,2 --msgid-bugs-address=inkscape-translator@lists.inkscape.org --from-code=UTF-8 -ktranslatable -o ${_potFile}) -- GitLab