Projects
Multimedia
synfig
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 53
View file
_service
Changed
@@ -209,7 +209,7 @@ <param name="exclude">version-bump.sh</param> <param name="exclude">version-release.sh</param> <param name="filename">synfig</param> - <param name="revision">d8951f9c2a61308d5a54951d01c63102472d5ef1</param> + <param name="revision">79bf708e2483cba678fc93f0ecf48b2178263795</param> <param name="scm">git</param> <param name="submodules">disable</param> <param name="url">https://github.com/synfig/synfig.git</param>
View file
_service:obs_scm:synfig-1.5.5.obscpio/.gemini
Added
+(directory)
View file
_service:obs_scm:synfig-1.5.5.obscpio/.gemini/config.yaml
Added
@@ -0,0 +1,13 @@ +have_fun: false +memory_config: + disabled: false +code_review: + disable: false + comment_severity_threshold: HIGH + max_review_comments: -1 + pull_request_opened: + help: false + summary: false + code_review: true + include_drafts: true +ignore_patterns: \ No newline at end of file
View file
_service:obs_scm:synfig-1.5.4.obscpio/synfig-core/po/POTFILES.in -> _service:obs_scm:synfig-1.5.5.obscpio/synfig-core/po/POTFILES.in
Changed
@@ -322,6 +322,8 @@ src/synfig/valuenode.cpp src/synfig/valuenode.h src/synfig/valuenode_registry.cpp +src/synfig/valuenodes/valuenode_absolute.cpp +src/synfig/valuenodes/valuenode_absolute.h src/synfig/valuenodes/valuenode_add.cpp src/synfig/valuenodes/valuenode_add.h src/synfig/valuenodes/valuenode_and.cpp
View file
_service:obs_scm:synfig-1.5.4.obscpio/synfig-core/src/modules/lyr_std/bevel.cpp -> _service:obs_scm:synfig-1.5.5.obscpio/synfig-core/src/modules/lyr_std/bevel.cpp
Changed
@@ -460,6 +460,9 @@ rendering::Task::Handle Layer_Bevel::build_composite_fork_task_vfunc(ContextParams /*context_params*/, rendering::Task::Handle sub_task) const { + if (!sub_task) + return sub_task; + TaskBevel::Handle task_bevel(new TaskBevel()); task_bevel->softness = param_softness.get(Real()); task_bevel->type = param_type.get(int());
View file
_service:obs_scm:synfig-1.5.4.obscpio/synfig-core/src/modules/mod_filter/colorcorrect.cpp -> _service:obs_scm:synfig-1.5.5.obscpio/synfig-core/src/modules/mod_filter/colorcorrect.cpp
Changed
@@ -42,9 +42,12 @@ #include <synfig/paramdesc.h> #include <synfig/renddesc.h> #include <synfig/value.h> +#include <synfig/canvas.h> #include <synfig/rendering/common/task/taskpixelprocessor.h> +#include <algorithm> + #endif /* === U S I N G =========================================================== */ @@ -59,10 +62,90 @@ SYNFIG_LAYER_SET_NAME(Layer_ColorCorrect,"colorcorrect"); SYNFIG_LAYER_SET_LOCAL_NAME(Layer_ColorCorrect,N_("Color Correct")); SYNFIG_LAYER_SET_CATEGORY(Layer_ColorCorrect,N_("Filters")); -SYNFIG_LAYER_SET_VERSION(Layer_ColorCorrect,"0.1"); +SYNFIG_LAYER_SET_VERSION(Layer_ColorCorrect,"0.2"); + +// Task tokens for saturation +rendering::Task::Token TaskSaturation::token( + DescAbstract<TaskSaturation>("Saturation") ); +rendering::Task::Token TaskSaturationSW::token( + DescReal<TaskSaturationSW, TaskSaturation>("SaturationSW") ); /* === P R O C E D U R E S ================================================= */ +//! Shared implementation for saturation adjustment +//! Used by both TaskSaturationSW and Layer_ColorCorrect::correct_color() +static inline void +apply_saturation_impl(Color& dst, const Color& src, Real saturation, const Gamma& canvas_gamma) +{ + dst = src; + + if (approximate_equal_lp(saturation, Real(1.0))) + return; + + // Linearize colors using canvas gamma (inverse gamma) + // This ensures saturation is computed in linear color space + Gamma inv_gamma = canvas_gamma.get_inverted(); + Color linear = inv_gamma.apply(dst); + + // Find the max (Value) and min of RGB components in linear space + ColorReal max_val = std::max({linear.get_r(), linear.get_g(), linear.get_b()}); + ColorReal min_val = std::min({linear.get_r(), linear.get_g(), linear.get_b()}); + + // Only adjust if there's actual saturation (max != min) and max > 0 + if (max_val > 0 && max_val != min_val) { + // Move each component toward max_val based on saturation factor + // At saturation=0, all components become max_val (grayscale at Value) + // At saturation=1, no change + // At saturation>1, components move away from max_val (more saturated) + ColorReal sat = static_cast<ColorReal>(saturation); + linear.set_r(max_val - (max_val - linear.get_r()) * sat); + linear.set_g(max_val - (max_val - linear.get_g()) * sat); + linear.set_b(max_val - (max_val - linear.get_b()) * sat); + + // Reapply gamma to return to gamma-corrected space + dst = canvas_gamma.apply(linear); + } +} + +void +TaskSaturationSW::apply_saturation(Color& dst, const Color& src) const +{ + apply_saturation_impl(dst, src, saturation, canvas_gamma); +} + +bool +TaskSaturationSW::run(RunParams&) const +{ + // Validation checks matching TaskPixelGammaSW pattern + if (!is_valid() || !sub_task() || !sub_task()->is_valid()) + return true; + + RectInt rd = target_rect; + VectorInt offset = get_offset(); + RectInt rs = sub_task()->target_rect + rd.get_min() + offset; + rect_set_intersect(rs, rs, rd); + if (rs.is_valid()) { + LockWrite ldst(this); + if (!ldst) + return false; + LockRead lsrc(sub_task()); + if (!lsrc) + return false; + + synfig::Surface& dst = ldst->get_surface(); + const synfig::Surface& src = lsrc->get_surface(); + + for (int y = rs.miny; y < rs.maxy; ++y) { + const Color* src_ptr = &srcy - rd.miny - offset1rs.minx - rd.minx - offset0; + Color* dst_ptr = &dstyrs.minx; + for (int x = rs.minx; x < rs.maxx; ++x, ++src_ptr, ++dst_ptr) + apply_saturation(*dst_ptr, *src_ptr); + } + } + + return true; +} + /* === M E T H O D S ======================================================= */ /* === E N T R Y P O I N T ================================================= */ @@ -72,6 +155,7 @@ param_brightness(ValueBase(Real(0))), param_contrast(ValueBase(Real(1.0))), param_exposure(ValueBase(Real(0.0))), + param_saturation(ValueBase(Real(1.0))), param_gamma(ValueBase(Real(1.0))) { SET_INTERPOLATION_DEFAULTS(); @@ -88,7 +172,22 @@ Real brightness((_brightness-0.5)*contrast+0.5); - Color ret = gamma.apply(in); + // Apply RGB-based saturation adjustment BEFORE gamma correction + // Saturation should be computed in linear color space for correct results + Color ret = in; + Real saturation = param_saturation.get(Real()); + if (!approximate_equal_lp(saturation, Real(1.0))) + { + // Get canvas gamma for linearization + Gamma local_canvas_gamma(1.0); + if (get_canvas()) + local_canvas_gamma = get_canvas()->get_root()->rend_desc().get_gamma(); + + apply_saturation_impl(ret, in, saturation, local_canvas_gamma); + } + + // Apply gamma after saturation + ret = gamma.apply(ret); assert(!std::isnan(ret.get_r())); assert(!std::isnan(ret.get_g())); @@ -152,6 +251,7 @@ IMPORT_VALUE(param_brightness); IMPORT_VALUE(param_contrast); IMPORT_VALUE(param_exposure); + IMPORT_VALUE(param_saturation); IMPORT_VALUE_PLUS(param_gamma, { @@ -168,6 +268,7 @@ EXPORT_VALUE(param_brightness); EXPORT_VALUE(param_contrast); EXPORT_VALUE(param_exposure); + EXPORT_VALUE(param_saturation); if(param=="gamma") { @@ -203,6 +304,11 @@ .set_local_name(_("Exposure Adjust")) ); + ret.push_back(ParamDesc("saturation") + .set_local_name(_("Saturation")) + .set_description(_("Color saturation adjustment. 0.0 = grayscale, 1.0 = no change, >1.0 = more saturated")) + ); + ret.push_back(ParamDesc("gamma") .set_local_name(_("Gamma Adjustment")) ); @@ -227,6 +333,20 @@ { rendering::Task::Handle task = context.build_rendering_task(); + // Apply RGB-based saturation adjustment first (before gamma) + // Saturation should be applied in linear color space for correct results + Real saturation = param_saturation.get(Real()); + if (!approximate_equal_lp(saturation, Real(1.0))) + { + TaskSaturation::Handle task_saturation(new TaskSaturation()); + task_saturation->saturation = saturation; + // Pass canvas gamma so saturation can linearize colors before adjustment + if (get_canvas()) + task_saturation->canvas_gamma = get_canvas()->get_root()->rend_desc().get_gamma(); + task_saturation->sub_task() = task; + task = task_saturation; + } + ColorReal gamma = param_gamma.get(Real()); if (!approximate_equal_lp(gamma, ColorReal(1.0))) {
View file
_service:obs_scm:synfig-1.5.4.obscpio/synfig-core/src/modules/mod_filter/colorcorrect.h -> _service:obs_scm:synfig-1.5.5.obscpio/synfig-core/src/modules/mod_filter/colorcorrect.h
Changed
@@ -35,6 +35,8 @@ #include <synfig/angle.h> #include <synfig/color.h> #include <synfig/rect.h> +#include <synfig/rendering/common/task/taskpixelprocessor.h> +#include <synfig/rendering/software/task/tasksw.h> /* === M A C R O S ========================================================= */ @@ -46,6 +48,38 @@ namespace modules { namespace mod_filter { +//! Task for RGB-based saturation adjustment +class TaskSaturation: public rendering::TaskPixelProcessor +{ +public: + typedef etl::handle<TaskSaturation> Handle; + static Token token; + Token::Handle get_token() const override { return token.handle(); } + + Real saturation; + Gamma canvas_gamma; //!< Canvas gamma for linearization + + TaskSaturation(): saturation(1.0), canvas_gamma(1.0) { } + + bool is_transparent() const + { return approximate_equal_lp(saturation, Real(1.0)); } +}; + + +//! Software implementation of TaskSaturation +class TaskSaturationSW: public TaskSaturation, public rendering::TaskSW +{ +public: + typedef etl::handle<TaskSaturationSW> Handle; + static Token token; + Token::Handle get_token() const override { return token.handle(); } + + bool run(RunParams& params) const override; +private: + void apply_saturation(Color& dst, const Color& src) const; +}; + + class Layer_ColorCorrect : public Layer { SYNFIG_LAYER_MODULE_EXT @@ -60,6 +94,8 @@ //! Parameter: (Real) ValueBase param_exposure; //! Parameter: (Real) + ValueBase param_saturation; + //! Parameter: (Real) ValueBase param_gamma; // This gamma member is kept to avoid need to recalculate the gamma table // on each pixel
View file
_service:obs_scm:synfig-1.5.4.obscpio/synfig-core/src/synfig/layer.h -> _service:obs_scm:synfig-1.5.5.obscpio/synfig-core/src/synfig/layer.h
Changed
@@ -615,7 +615,7 @@ //! Get the needed renddesc for context layers. /*! * For the given renddesc argument, returns the computed - * neeed renddesc for the underlying layer. + * need renddesc for the underlying layer. * It basically sets the vector rectangle coordinates of * the context/underlying layer. *
View file
_service:obs_scm:synfig-1.5.4.obscpio/synfig-core/src/synfig/rendering/software/function/blur.cpp -> _service:obs_scm:synfig-1.5.5.obscpio/synfig-core/src/synfig/rendering/software/function/blur.cpp
Changed
@@ -288,7 +288,7 @@ for(Array<ColorReal, 3>::Iterator src_channel(arr_src_surface_cols), dst_channel(arr_dst_surface_cols); dst_channel; ++src_channel, ++dst_channel) for(Array<ColorReal, 2>::Iterator sr(*src_channel), dr(*dst_channel); dr; ++sr, ++dr) - BlurTemplates::blur_pattern(*dr, *sr, arr_row_pattern); + BlurTemplates::blur_pattern(*dr, *sr, arr_col_pattern); } // copy result surface and restore alpha
View file
_service:obs_scm:synfig-1.5.4.obscpio/synfig-core/src/synfig/savecanvas.cpp -> _service:obs_scm:synfig-1.5.5.obscpio/synfig-core/src/synfig/savecanvas.cpp
Changed
@@ -541,12 +541,8 @@ std::vector<ValueNode_DynamicList::ListEntry> corrected_valuenode_list = value_node->list; if (must_rotate_point_list) { - if (must_rotate_point_list) { - if (corrected_valuenode_list.size() > 0) { - auto node = corrected_valuenode_list.front(); - corrected_valuenode_list.push_back(node); - corrected_valuenode_list.erase(corrected_valuenode_list.begin()); - } + if (corrected_valuenode_list.size() > 0) { + std::rotate(corrected_valuenode_list.begin(), corrected_valuenode_list.begin() + 1, corrected_valuenode_list.end()); } }
View file
_service:obs_scm:synfig-1.5.4.obscpio/synfig-core/src/synfig/valuenodes/Makefile_insert -> _service:obs_scm:synfig-1.5.5.obscpio/synfig-core/src/synfig/valuenodes/Makefile_insert
Changed
@@ -1,4 +1,5 @@ VALUENODES_HH = \ + valuenodes/valuenode_absolute.h \ valuenodes/valuenode_add.h \ valuenodes/valuenode_and.h \ valuenodes/valuenode_angle.h \ @@ -70,6 +71,7 @@ valuenodes/valuenode_weightedaverage.h VALUENODES_CC = \ + valuenodes/valuenode_absolute.cpp \ valuenodes/valuenode_add.cpp \ valuenodes/valuenode_and.cpp \ valuenodes/valuenode_angle.cpp \
View file
_service:obs_scm:synfig-1.5.5.obscpio/synfig-core/src/synfig/valuenodes/valuenode_absolute.cpp
Added
@@ -0,0 +1,229 @@ +/* === S Y N F I G ========================================================= */ +/*! \file valuenode_absolute.cpp +** \brief Implementation of the "Absolute" valuenode conversion. +** +** \legal +** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2007, 2008 Chris Moore +** Copyright (c) 2011 Carlos López +** Copyright (c) 2025 BobSynfig +** +** This file is part of Synfig. +** +** Synfig is free software: you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation, either version 2 of the License, or +** (at your option) any later version. +** +** Synfig is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with Synfig. If not, see <https://www.gnu.org/licenses/>. +** \endlegal +*/ +/* ========================================================================= */ + +/* === H E A D E R S ======================================================= */ + +#ifdef USING_PCH +# include "pch.h" +#else +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include "valuenode_absolute.h" +#include "valuenode_const.h" + +#include <synfig/general.h> +#include <synfig/localization.h> +#include <synfig/valuenode_registry.h> +#include <stdexcept> +#include <synfig/misc.h> +#include <synfig/angle.h> +#include <synfig/real.h> + +#endif + +/* === U S I N G =========================================================== */ + +using namespace synfig; + +/* === M A C R O S ========================================================= */ + +/* === G L O B A L S ======================================================= */ + +REGISTER_VALUENODE(ValueNode_Absolute, RELEASE_VERSION_1_6_0, "absolute", N_("Absolute")) + +/* === P R O C E D U R E S ================================================= */ + +/* === M E T H O D S ======================================================= */ + +ValueNode_Absolute::ValueNode_Absolute(const ValueBase& value): + LinkableValueNode( value.get_type() ) +{ + init_children_vocab(); + + Type& type( value.get_type() ); + + if (type == type_angle) + set_link("link", ValueNode_Const::create( value.get( Angle() ) ) ); + else + if (type == type_integer) + set_link("link", ValueNode_Const::create( value.get( int() ) ) ); + else + if (type == type_real) + set_link("link", ValueNode_Const::create( value.get( Real() ) ) ); + else + { + assert(0); + throw std::runtime_error( get_local_name() + _(":Bad type ") + type.description.local_name); + } + + assert(value_node); + assert(value_node->get_type() == type); + assert(get_type() == type); +} + +LinkableValueNode* +ValueNode_Absolute::create_new() const +{ + return new ValueNode_Absolute( get_type() ); +} + +ValueNode_Absolute* +ValueNode_Absolute::create(const ValueBase& value, etl::loose_handle<Canvas>) +{ + return new ValueNode_Absolute( value ); +} + +synfig::ValueNode_Absolute::~ValueNode_Absolute() +{ + unlink_all(); +} + +synfig::ValueBase +synfig::ValueNode_Absolute::operator()(Time t) const +{ + DEBUG_LOG("SYNFIG_DEBUG_VALUENODE_OPERATORS", + "%s:%d operator()\n", __FILE__, __LINE__); + + if (!value_node) + throw std::runtime_error( + strprintf( "ValueNode_Absolute: %s", + _("My parameter isn't set!" ) + ) + ); + else + if ( get_type() == type_angle ) + return + Angle::deg( + std::abs( + Angle::deg( + (*value_node)(t).get( Angle() ) + ).get() + ) + ); + else + if ( get_type() == type_integer) + return std::abs( (*value_node)(t).get( int() ) ); + else + if ( get_type() == type_real ) + return std::abs( (*value_node)(t).get( Real() ) ); + + assert(0); + return ValueBase(); +} + +synfig::ValueBase +synfig::ValueNode_Absolute::get_inverse(const Time& t, const synfig::ValueBase& target_value) const +{ + const Type& target_type = target_value.get_type(); + + if (target_type == type_angle) + return target_value.get( Angle() ); + + if (target_type == type_integer) + return target_value.get( int() ); + + if (target_type == type_real) + return target_value.get( Real() ); + + throw std::runtime_error( + strprintf( "ValueNode_%s: %s: %s", + get_name().c_str(), + _("Attempting to get the inverse of a non invertible Valuenode"), + _("Invalid value type") + ) + ); +} + +LinkableValueNode::InvertibleStatus +synfig::ValueNode_Absolute::is_invertible(const Time& t, const ValueBase& target_value, int* link_index) const +{ + if ( !t.is_valid() ) + return INVERSE_ERROR_BAD_TIME; + + const Type& type = target_value.get_type(); + + if ( type != type_angle && + type != type_real && + type != type_integer ) + return INVERSE_ERROR_BAD_TYPE; + + if (link_index) + *link_index = get_link_index_from_name("link"); + + return INVERSE_OK; +} + +bool +ValueNode_Absolute::set_link_vfunc(int i, ValueNode::Handle value) +{ + assert( i>=0 && i<link_count() ); + + switch(i) + { + case 0: CHECK_TYPE_AND_SET_VALUE(value_node, get_type()); + } + return false; +} + +ValueNode::LooseHandle +ValueNode_Absolute::get_link_vfunc(int i) const +{ + assert( i>=0 && i<link_count() ); + + if (i == 0) return value_node; + + return nullptr; +} + +bool +ValueNode_Absolute::check_type(Type &type) +{ + return + type == type_angle || + type == type_integer || + type == type_real; +} + +LinkableValueNode::Vocab +ValueNode_Absolute::get_children_vocab_vfunc() const +{ + if ( children_vocab.size() ) + return children_vocab; + + LinkableValueNode::Vocab ret; + + ret.push_back( + ParamDesc("link") + .set_local_name ( _("Link") ) + .set_description( _("The value node used to obtain the absolute value") ) + ); + + return ret; +}
View file
_service:obs_scm:synfig-1.5.5.obscpio/synfig-core/src/synfig/valuenodes/valuenode_absolute.h
Added
@@ -0,0 +1,94 @@ +/* === S Y N F I G ========================================================= */ +/*! \file valuenode_absolute.h +** \brief Header file for implementation of the "Absolute" valuenode conversion. +** +** \legal +** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2007, 2008 Chris Moore +** Copyright (c) 2011 Carlos López +** Copyright (c) 2025 BobSynfig +** +** This file is part of Synfig. +** +** Synfig is free software: you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation, either version 2 of the License, or +** (at your option) any later version. +** +** Synfig is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with Synfig. If not, see <https://www.gnu.org/licenses/>. +** \endlegal +*/ +/* ========================================================================= */ + +/* === S T A R T =========================================================== */ + +#ifndef __SYNFIG_VALUENODE_ABSOLUTE_H +#define __SYNFIG_VALUENODE_ABSOLUTE_H + +/* === H E A D E R S ======================================================= */ + +#include <synfig/valuenode.h> + +/* === M A C R O S ========================================================= */ + +/* === C L A S S E S & S T R U C T S ======================================= */ + +namespace synfig { + +class ValueNode_Absolute : public LinkableValueNode +{ + ValueNode::RHandle value_node; + + ValueNode_Absolute( const ValueBase &value ); + +public: + typedef etl::handle<ValueNode_Absolute> Handle; + typedef etl::handle<const ValueNode_Absolute> ConstHandle; + + static ValueNode_Absolute* create(const ValueBase& x, etl::loose_handle<Canvas> canvas = nullptr); + virtual ~ValueNode_Absolute(); + + virtual String get_name() const override; + virtual String get_local_name() const override; + static bool check_type(Type &type); + + //! Checks if it is possible to call get_inverse() for target_value at time t. + //! If so, return the link_index related to the return value provided by get_inverse() + virtual InvertibleStatus + is_invertible(const Time& t, + const ValueBase& target_value, + int* link_index = nullptr) const override; + + //! Returns the modified Link to match the target value at time t + virtual ValueBase + get_inverse(const Time& t, + const synfig::ValueBase &target_value) const override; + + virtual ValueBase + operator()(Time t) const override; + +protected: + virtual LinkableValueNode* + create_new() const override; + + virtual bool + set_link_vfunc(int i, ValueNode::Handle x) override; + + virtual ValueNode::LooseHandle + get_link_vfunc(int i) const override; + + virtual Vocab + get_children_vocab_vfunc() const override; +}; // END of class ValueNode_Absolute + +}; // END of namespace synfig + +/* === E N D =============================================================== */ + +#endif
View file
_service:obs_scm:synfig-1.5.4.obscpio/synfig-core/test/filesystem_path.cpp -> _service:obs_scm:synfig-1.5.5.obscpio/synfig-core/test/filesystem_path.cpp
Changed
@@ -258,10 +258,13 @@ Path q1("/a/b"); Path q2("/a/c"); ASSERT_EQUAL(0, q1.compare(q1)) - ASSERT_EQUAL(-1, q1.compare(q2)) - ASSERT_EQUAL(1, q2.compare(q1)) + ASSERT(0 > q1.compare(q2)) + ASSERT(0 < q2.compare(q1)) ASSERT(0 > Path("/aa/").compare(Path("/ac/"))) + ASSERT(0 < Path("/ac/").compare(Path("/aa/"))) + + ASSERT(0 > Path("/aa").compare(Path("/ac"))) ASSERT(0 < Path("/ac").compare(Path("/aa"))) ASSERT(0 > Path("aa/abb").compare(Path("aa/c")))
View file
_service:obs_scm:synfig-1.5.4.obscpio/synfig-studio/org.synfig.SynfigStudio.appdata.xml.in -> _service:obs_scm:synfig-1.5.5.obscpio/synfig-studio/org.synfig.SynfigStudio.appdata.xml.in
Changed
@@ -55,6 +55,6 @@ <url type="translate">https://www.transifex.com/morevnaproject/synfig/</url> <content_rating type="oars-1.1"/> <releases> - <release version="1.5.4" date="2026-01-18"></release> + <release version="1.5.5" date="2026-03-15"></release> </releases> </component>
View file
_service:obs_scm:synfig-1.5.4.obscpio/synfig-studio/plugins/add-skeleton-simple/stickman.sif -> _service:obs_scm:synfig-1.5.5.obscpio/synfig-studio/plugins/add-skeleton-simple/stickman.sif
Changed
@@ -112,7 +112,7 @@ </param> <param name="canvas"> <canvas> - <layer type="group" active="true" exclude_from_rendering="false" version="0.2" desc="(stk)-forearm2"> + <layer type="group" active="true" exclude_from_rendering="false" version="0.2" desc="(stk)-arm2"> <param name="z_depth"> <real value="0.0000000000"/> </param> @@ -596,7 +596,7 @@ <real value="0.0000000000"/> </param> </layer> - <layer type="group" active="true" exclude_from_rendering="false" version="0.2" desc="(stk)-arm2"> + <layer type="group" active="true" exclude_from_rendering="false" version="0.2" desc="(stk)-forearm2"> <param name="z_depth"> <real value="0.0000000000"/> </param> @@ -1690,7 +1690,7 @@ <real value="0.0000000000"/> </param> </layer> - <layer type="group" active="true" exclude_from_rendering="false" version="0.2" desc="(stk)-forearm1"> + <layer type="group" active="true" exclude_from_rendering="false" version="0.2" desc="(stk)-arm1"> <param name="z_depth"> <real value="0.0000000000"/> </param> @@ -2174,7 +2174,7 @@ <real value="0.0000000000"/> </param> </layer> - <layer type="group" active="true" exclude_from_rendering="false" version="0.2" desc="(stk)-arm1"> + <layer type="group" active="true" exclude_from_rendering="false" version="0.2" desc="(stk)-forearm1"> <param name="z_depth"> <real value="0.0000000000"/> </param>
View file
_service:obs_scm:synfig-1.5.4.obscpio/synfig-studio/src/gui/canvasview.cpp -> _service:obs_scm:synfig-1.5.5.obscpio/synfig-studio/src/gui/canvasview.cpp
Changed
@@ -640,7 +640,6 @@ drag_dest_set(listTargets); signal_drag_data_received().connect(sigc::mem_fun(*this, &CanvasView::on_drop_drag_data_received)); - hide_tables(); show(); instance->canvas_view_list().push_front(this); @@ -1690,7 +1689,6 @@ void CanvasView::on_refresh_pressed() { - rebuild_tables(); rebuild_ducks(); work_area->queue_render(); } @@ -1889,27 +1887,6 @@ } void -CanvasView::refresh_tables() -{ -// if(layer_tree_store_)layer_tree_store_->refresh(); -// if(children_tree_store_)children_tree_store_->refresh(); -} - -void -CanvasView::rebuild_tables() -{ -// layer_tree_store_->rebuild(); -// children_tree_store_->rebuild(); -} - -void -CanvasView::build_tables() -{ -// layer_tree_store_->rebuild(); -// children_tree_store_->rebuild(); -} - -void CanvasView::on_layer_toggle(Layer::Handle layer) { Action::Handle action(Action::create("LayerActivate"));
View file
_service:obs_scm:synfig-1.5.4.obscpio/synfig-studio/src/gui/canvasview.h -> _service:obs_scm:synfig-1.5.5.obscpio/synfig-studio/src/gui/canvasview.h
Changed
@@ -597,26 +597,12 @@ void new_child_canvas(); - //! Rebuilds layer_tree_store_ from the Canvas. Maintains selected items. - void rebuild_tables(); - - //! Builds layer_tree_store_ from the Canvas. Does not maintain selected items. - void build_tables(); - - //! Refreshes the data for the tables - void refresh_tables(); - //! \writeme void rebuild_ducks(); void play_async(); void stop_async(); - //! Show/hide the tables (Layer/Children). TODO: seems deprecated - void show_tables() { } - void hide_tables() { } - bool tables_are_visible() { return false; } - //! Shows the time bar void show_timebar();
View file
_service:obs_scm:synfig-1.5.4.obscpio/synfig-studio/src/gui/docks/dockdialog.cpp -> _service:obs_scm:synfig-1.5.5.obscpio/synfig-studio/src/gui/docks/dockdialog.cpp
Changed
@@ -105,8 +105,6 @@ DockDialog::~DockDialog() { - empty_sig.disconnect(); - is_deleting=true; // Remove us from the dock manager @@ -164,7 +162,6 @@ DEBUG_LOG("SYNFIG_DEBUG_DESTRUCTORS", "DockDialog::close(): Deleted"); - empty_sig.disconnect(); //get_dock_book().clear(); delete this; return false;
View file
_service:obs_scm:synfig-1.5.4.obscpio/synfig-studio/src/gui/docks/dockdialog.h -> _service:obs_scm:synfig-1.5.5.obscpio/synfig-studio/src/gui/docks/dockdialog.h
Changed
@@ -52,8 +52,6 @@ friend class DockBook; friend class Dockable; - sigc::connection empty_sig; - bool is_deleting; private:
View file
_service:obs_scm:synfig-1.5.4.obscpio/synfig-studio/src/gui/duckmatic.cpp -> _service:obs_scm:synfig-1.5.5.obscpio/synfig-studio/src/gui/duckmatic.cpp
Changed
@@ -1243,6 +1243,7 @@ Duckmatic::clear_persistent_strokes() { persistent_stroke_list_.clear(); + redo_stroke_list_.clear(); } void
View file
_service:obs_scm:synfig-1.5.4.obscpio/synfig-studio/src/gui/duckmatic.h -> _service:obs_scm:synfig-1.5.5.obscpio/synfig-studio/src/gui/duckmatic.h
Changed
@@ -173,6 +173,8 @@ std::list<etl::handle<Stroke> > persistent_stroke_list_; + std::list<etl::handle<Stroke>> redo_stroke_list_; + synfig::GUIDSet selected_ducks; synfig::GUID last_duck_guid; @@ -331,6 +333,10 @@ std::list<etl::handle<Stroke> >& persistent_stroke_list() { return persistent_stroke_list_; } + std::list<etl::handle<Stroke>>& redo_stroke_list() { return redo_stroke_list_; } + + const std::list<etl::handle<Stroke>>& redo_stroke_list() const { return redo_stroke_list_; } + /* -- ** -- D U C K S E L E C T I O N M E T H O D S---------------------------- */
View file
_service:obs_scm:synfig-1.5.4.obscpio/synfig-studio/src/gui/modules/mod_palette/dock_paledit.cpp -> _service:obs_scm:synfig-1.5.5.obscpio/synfig-studio/src/gui/modules/mod_palette/dock_paledit.cpp
Changed
@@ -432,7 +432,7 @@ synfig::error(_("Trying to get hex code from an invalid index for the palette: %i"), i); return; } - // Taking first 7 characters of the color string as they contain the formated #hexadecimal color + // Taking first 7 characters of the color string as they contain the formatted #hexadecimal color Glib::RefPtr<Gtk::Clipboard> refClipboard = Gtk::Clipboard::get(); refClipboard->set_text(palette_i.color.get_string().substr(0, 7)); }
View file
_service:obs_scm:synfig-1.5.4.obscpio/synfig-studio/src/gui/states/state_bline.cpp -> _service:obs_scm:synfig-1.5.5.obscpio/synfig-studio/src/gui/states/state_bline.cpp
Changed
@@ -91,7 +91,6 @@ CanvasView::Handle canvas_view_; CanvasView::IsWorking is_working; - bool prev_table_status; bool loop_; bool prev_workarea_layer_status_; @@ -451,7 +450,6 @@ StateBLine_Context::StateBLine_Context(CanvasView* canvas_view): canvas_view_(canvas_view), is_working(*canvas_view), - prev_table_status(false), loop_(false), prev_workarea_layer_status_(get_work_area()->get_allow_layer_clicks()), depth(-1), @@ -603,10 +601,6 @@ // Refresh the work area get_work_area()->queue_draw(); - // Hide the tables if they are showing - prev_table_status=get_canvas_view()->tables_are_visible(); - if(prev_table_status)get_canvas_view()->hide_tables(); - // Disable the time bar get_canvas_view()->set_sensitive_timebar(false); @@ -670,9 +664,6 @@ // Enable the time bar get_canvas_view()->set_sensitive_timebar(true); - // Bring back the tables if they were out before - if(prev_table_status)get_canvas_view()->show_tables(); - // Refresh the work area get_work_area()->queue_draw();
View file
_service:obs_scm:synfig-1.5.4.obscpio/synfig-studio/src/gui/states/state_bone.cpp -> _service:obs_scm:synfig-1.5.5.obscpio/synfig-studio/src/gui/states/state_bone.cpp
Changed
@@ -80,7 +80,6 @@ CanvasView::Handle canvas_view_; CanvasView::IsWorking is_working; - bool prev_table_status; bool prev_workarea_layer_status_; Duck::Type prev_type_mask; @@ -328,7 +327,6 @@ StateBone_Context::StateBone_Context(CanvasView *canvas_view) : canvas_view_(canvas_view), is_working(*canvas_view), - prev_table_status(false), prev_workarea_layer_status_(get_work_area()->get_allow_layer_clicks()), //depth(-1), active_bone(get_work_area()->get_active_bone_value_node()), @@ -445,10 +443,6 @@ // Refresh the work area get_work_area()->queue_draw(); - // Hide the tables if they are showing - prev_table_status=get_canvas_view()->tables_are_visible(); - if(prev_table_status)get_canvas_view()->hide_tables(); - // Disable the time bar get_canvas_view()->set_sensitive_timebar(false); @@ -529,9 +523,6 @@ // Enable the time bar get_canvas_view()->set_sensitive_timebar(true); - // Bring back the tables if they were out before - if(prev_table_status)get_canvas_view()->show_tables(); - // Refresh the work area get_work_area()->queue_draw();
View file
_service:obs_scm:synfig-1.5.4.obscpio/synfig-studio/src/gui/states/state_draw.cpp -> _service:obs_scm:synfig-1.5.5.obscpio/synfig-studio/src/gui/states/state_draw.cpp
Changed
@@ -101,8 +101,6 @@ WorkArea::PushState push_state; - bool prev_table_status; - int nested; sigc::connection process_queue_connection; @@ -756,10 +754,6 @@ // Turn off duck clicking get_work_area()->set_allow_duck_clicks(false); - // Hide the tables if they are showing - prev_table_status=get_canvas_view()->tables_are_visible(); - //if(prev_table_status)get_canvas_view()->hide_tables(); - // Disable the time bar get_canvas_view()->set_sensitive_timebar(false); @@ -831,9 +825,6 @@ // Enable the time bar get_canvas_view()->set_sensitive_timebar(true); - // Bring back the tables if they were out before - if(prev_table_status)get_canvas_view()->show_tables(); - // Refresh the work area get_work_area()->queue_draw();
View file
_service:obs_scm:synfig-1.5.4.obscpio/synfig-studio/src/gui/states/state_gradient.cpp -> _service:obs_scm:synfig-1.5.5.obscpio/synfig-studio/src/gui/states/state_gradient.cpp
Changed
@@ -442,9 +442,6 @@ get_work_area()->refresh_cursor(); - // Hide the tables if they are showing - get_canvas_view()->hide_tables(); - // Disable the time bar //get_canvas_view()->set_sensitive_timebar(false); @@ -484,16 +481,11 @@ // Enable the time bar //get_canvas_view()->set_sensitive_timebar(true); - // Bring back the tables if they were out before - //if(prev_table_status)get_canvas_view()->show_tables(); - // Refresh the work area get_work_area()->queue_draw(); get_canvas_view()->queue_rebuild_ducks(); - //get_canvas_view()->show_tables(); - get_work_area()->refresh_cursor(); App::dock_toolbox->refresh();
View file
_service:obs_scm:synfig-1.5.4.obscpio/synfig-studio/src/gui/states/state_lasso.cpp -> _service:obs_scm:synfig-1.5.5.obscpio/synfig-studio/src/gui/states/state_lasso.cpp
Changed
@@ -100,8 +100,6 @@ WorkArea::PushState push_state; - bool prev_table_status; - int nested; sigc::connection process_queue_connection; @@ -683,10 +681,6 @@ // Turn off duck clicking get_work_area()->set_allow_duck_clicks(false); - // Hide the tables if they are showing - prev_table_status=get_canvas_view()->tables_are_visible(); - //if(prev_table_status)get_canvas_view()->hide_tables(); - // Disable the time bar get_canvas_view()->set_sensitive_timebar(false); @@ -758,9 +752,6 @@ // Enable the time bar get_canvas_view()->set_sensitive_timebar(true); - // Bring back the tables if they were out before - if(prev_table_status)get_canvas_view()->show_tables(); - // Refresh the work area get_work_area()->queue_draw();
View file
_service:obs_scm:synfig-1.5.4.obscpio/synfig-studio/src/gui/states/state_normal.cpp -> _service:obs_scm:synfig-1.5.5.obscpio/synfig-studio/src/gui/states/state_normal.cpp
Changed
@@ -568,7 +568,6 @@ StateNormal_Context::event_refresh_handler(const Smach::event& /*x*/) { // synfig::info("STATE NORMAL: Received Refresh Event"); - canvas_view_->rebuild_tables(); canvas_view_->get_work_area()->queue_render(); return Smach::RESULT_ACCEPT; }
View file
_service:obs_scm:synfig-1.5.4.obscpio/synfig-studio/src/gui/states/state_polygon.cpp -> _service:obs_scm:synfig-1.5.5.obscpio/synfig-studio/src/gui/states/state_polygon.cpp
Changed
@@ -86,7 +86,6 @@ CanvasView::Handle canvas_view_; CanvasView::IsWorking is_working; - bool prev_table_status; bool prev_workarea_layer_status_; Duckmatic::Push duckmatic_push; @@ -546,10 +545,6 @@ get_work_area()->set_cursor(Gdk::CROSSHAIR); - // Hide the tables if they are showing - prev_table_status=get_canvas_view()->tables_are_visible(); - if(prev_table_status)get_canvas_view()->hide_tables(); - // Disable the time bar get_canvas_view()->set_sensitive_timebar(false); @@ -610,9 +605,6 @@ // Enable the time bar get_canvas_view()->set_sensitive_timebar(true); - // Bring back the tables if they were out before - if(prev_table_status)get_canvas_view()->show_tables(); - // Refresh the work area get_work_area()->queue_draw();
View file
_service:obs_scm:synfig-1.5.4.obscpio/synfig-studio/src/gui/states/state_sketch.cpp -> _service:obs_scm:synfig-1.5.5.obscpio/synfig-studio/src/gui/states/state_sketch.cpp
Changed
@@ -76,12 +76,11 @@ WorkArea::PushState push_state; - bool prev_table_status; - Gtk::Grid options_grid; Gtk::Label title_label; Gtk::Button button_clear_sketch; Gtk::Button button_undo_stroke; + Gtk::Button button_redo_stroke; Gtk::Button button_save_sketch; Gtk::Button button_load_sketch; @@ -93,6 +92,7 @@ void save_sketch(); void load_sketch(); void undo_stroke(); + void redo_stroke(); void toggle_show_sketch(); public: @@ -201,14 +201,40 @@ void StateSketch_Context::undo_stroke() { - if(!get_work_area()->persistent_stroke_list().empty()) - { - get_work_area()->persistent_stroke_list().pop_back(); + if (!get_work_area()->persistent_stroke_list().empty()) { + auto& undo_stroke_list = get_work_area()->persistent_stroke_list(); + auto& redo_stroke_list = get_work_area()->redo_stroke_list(); + + redo_stroke_list.splice( + redo_stroke_list.end(), + undo_stroke_list, + std::prev(undo_stroke_list.end()) + ); // if the sketch is currently shown, make sure it is updated //! \todo is there a better way than this of getting Duckmatic to update its stroke_list_? - if (show_sketch_checkbutton.get_active()) - { + if (show_sketch_checkbutton.get_active()) { + get_work_area()->set_show_persistent_strokes(false); + get_work_area()->set_show_persistent_strokes(true); + get_canvas_view()->get_smach().process_event(EVENT_REFRESH); + } + } +} + +void +StateSketch_Context::redo_stroke() +{ + if (!get_work_area()->redo_stroke_list().empty()) { + auto& redo_stroke_list = get_work_area()->redo_stroke_list(); + auto& undo_stroke_list = get_work_area()->persistent_stroke_list(); + + undo_stroke_list.splice( + undo_stroke_list.end(), + redo_stroke_list, + std::prev(redo_stroke_list.end()) + ); + + if (show_sketch_checkbutton.get_active()) { get_work_area()->set_show_persistent_strokes(false); get_work_area()->set_show_persistent_strokes(true); get_canvas_view()->get_smach().process_event(EVENT_REFRESH); @@ -232,6 +258,7 @@ button_clear_sketch.signal_clicked().connect(sigc::mem_fun(*this,&studio::StateSketch_Context::clear_sketch)); button_undo_stroke.signal_clicked().connect(sigc::mem_fun(*this,&studio::StateSketch_Context::undo_stroke)); + button_redo_stroke.signal_clicked().connect(sigc::mem_fun(*this,&studio::StateSketch_Context::redo_stroke)); button_save_sketch.signal_clicked().connect(sigc::mem_fun(*this,&studio::StateSketch_Context::save_sketch)); button_load_sketch.signal_clicked().connect(sigc::mem_fun(*this,&studio::StateSketch_Context::load_sketch)); show_sketch_checkbutton.signal_clicked().connect(sigc::mem_fun(*this,&studio::StateSketch_Context::toggle_show_sketch)); @@ -283,10 +310,6 @@ // Refresh the work area //get_work_area()->queue_draw(); - // Hide the tables if they are showing - prev_table_status=get_canvas_view()->tables_are_visible(); - //if(prev_table_status)get_canvas_view()->hide_tables(); - // Disable the time bar //get_canvas_view()->set_sensitive_timebar(false); @@ -305,9 +328,6 @@ // Enable the time bar //get_canvas_view()->set_sensitive_timebar(true); - // Bring back the tables if they were out before - if(prev_table_status)get_canvas_view()->show_tables(); - // Refresh the work area //get_work_area()->queue_draw(); @@ -332,6 +352,15 @@ ) ); App::dialog_tool_options->add_button( + "edit-redo", + _("Redo Last Stroke") + )->signal_clicked().connect( + sigc::mem_fun( + *this, + &studio::StateSketch_Context::redo_stroke + ) + ); + App::dialog_tool_options->add_button( "edit-clear", _("Clear Sketch") )->signal_clicked().connect( @@ -409,5 +438,7 @@ get_work_area()->add_persistent_stroke(event.stroke_data,synfigapp::Main::get_outline_color()); + get_work_area()->redo_stroke_list().clear(); + return Smach::RESULT_ACCEPT; }
View file
_service:obs_scm:synfig-1.5.4.obscpio/synfig-studio/src/gui/states/state_text.cpp -> _service:obs_scm:synfig-1.5.5.obscpio/synfig-studio/src/gui/states/state_text.cpp
Changed
@@ -454,10 +454,6 @@ // Refresh the work area get_work_area()->queue_draw(); - // Hide the tables if they are showing - //prev_table_status=get_canvas_view()->tables_are_visible(); - //if(prev_table_status)get_canvas_view()->hide_tables(); - // Disable the time bar //get_canvas_view()->set_sensitive_timebar(false);
View file
_service:obs_scm:synfig-1.5.4.obscpio/synfig-studio/src/synfigapp/instance.cpp -> _service:obs_scm:synfig-1.5.5.obscpio/synfig-studio/src/synfigapp/instance.cpp
Changed
@@ -47,6 +47,7 @@ #include <synfig/filesystem.h> #include <synfig/filesystemnative.h> #include <synfig/filesystemtemporary.h> +#include <synfig/valuenodes/valuenode_absolute.h> #include <synfig/valuenodes/valuenode_add.h> #include <synfig/valuenodes/valuenode_composite.h> #include <synfig/valuenodes/valuenode_const.h> @@ -97,8 +98,9 @@ bool synfigapp::is_editable(synfig::ValueNode::Handle value_node) { - if(ValueNode_Const::Handle::cast_dynamic(value_node) + if (ValueNode_Const::Handle::cast_dynamic(value_node) || ValueNode_Animated::Handle::cast_dynamic(value_node) + || ValueNode_Absolute::Handle::cast_dynamic(value_node) || ValueNode_Add::Handle::cast_dynamic(value_node) || ValueNode_Composite::Handle::cast_dynamic(value_node) || ValueNode_RadialComposite::Handle::cast_dynamic(value_node) @@ -124,7 +126,7 @@ etl::handle<Instance> synfigapp::find_instance(Canvas::Handle canvas) { - if(instance_map_.count(canvas)==0) + if (instance_map_.count(canvas) == 0) return 0; return instance_map_canvas; } @@ -156,7 +158,7 @@ } void -Instance::set_file_name(const synfig::String &name) +Instance::set_file_name(const synfig::String& name) { get_canvas()->set_file_name(name); } @@ -172,24 +174,24 @@ etl::handle<CanvasInterface> Instance::find_canvas_interface(synfig::Canvas::Handle canvas) { - if(!canvas) + if (!canvas) return 0; - while(canvas->is_inline()) - canvas=canvas->parent(); + while (canvas->is_inline()) + canvas = canvas->parent(); for (CanvasInterfaceList::iterator iter = canvas_interface_list().begin(); iter != canvas_interface_list().end(); ++iter) - if((*iter)->get_canvas()==canvas) + if ((*iter)->get_canvas() == canvas) return *iter; return CanvasInterface::create(this,canvas); } bool -Instance::import_external_canvas(Canvas::Handle canvas, std::map<Canvas*, Canvas::Handle> &imported) +Instance::import_external_canvas(Canvas::Handle canvas, std::map<Canvas*, Canvas::Handle>& imported) { etl::handle<CanvasInterface> canvas_interface; - for(IndependentContext i = canvas->get_independent_context(); *i; i++) + for (IndependentContext i = canvas->get_independent_context(); *i; i++) { Layer_PasteCanvas::Handle paste_canvas = Layer_PasteCanvas::Handle::cast_dynamic(*i); if (!paste_canvas) continue; @@ -204,8 +206,7 @@ if (!new_canvas) continue; // Action to link canvas - try - { + try { Action::Handle action(Action::LayerParamSet::create()); if (!action) continue; canvas_interface = find_canvas_interface(canvas); @@ -214,11 +215,10 @@ action->set_param("layer",Layer::Handle(paste_canvas)); action->set_param("param","canvas"); action->set_param("new_value",ValueBase(new_canvas)); - if(!action->is_ready()) continue; - if(!perform_action(action)) continue; + if (!action->is_ready()) continue; + if (!perform_action(action)) continue; } - catch(...) - { + catch(...) { continue; } } else { @@ -227,7 +227,7 @@ // generate name std::string fname = filesystem::Path::filename_sans_extension(filesystem::Path::basename(sub_canvas->get_file_name())); static const char bad_chars=" :#@$^&()*"; - for(std::string::iterator j = fname.begin(); j != fname.end(); ++j) + for (std::string::iterator j = fname.begin(); j != fname.end(); ++j) for (const char* k = bad_chars; *k != 0; ++k) if (*j == *k) { *j = '_'; break; } if (fname.empty()) fname = "canvas"; @@ -236,14 +236,12 @@ std::string name; bool found = false; - for(int j = 1; j < 1000; j++) - { + for (int j = 1; j < 1000; j++) { name = j == 1 ? fname : strprintf("%s_%d", fname.c_str(), j); - if (canvas->value_node_list().count(name) == false) - { + if (canvas->value_node_list().count(name) == false) { found = true; for (std::list<Canvas::Handle>::const_iterator iter = canvas->children().begin(); iter != canvas->children().end(); ++iter) - if(name==(*iter)->get_id()) + if (name == (*iter)->get_id()) { found = false; break; } if (found) break; } @@ -260,13 +258,12 @@ action->set_param("canvas_interface",canvas_interface); action->set_param("value_desc",ValueDesc(Layer::Handle(paste_canvas),std::string("canvas"))); action->set_param("name",name); - if(!action->is_ready()) continue; - if(!perform_action(action)) continue; + if (!action->is_ready()) continue; + if (!perform_action(action)) continue; std::string warnings; importedsub_canvas.get() = canvas->find_canvas(name, warnings); } - catch(...) - { + catch(...) { continue; } @@ -286,18 +283,18 @@ { synfigapp::Action::PassiveGrouper group(this, _("Import external canvases")); std::map<Canvas*, Canvas::Handle> imported; - while(import_external_canvas(get_canvas(), imported)); + while (import_external_canvas(get_canvas(), imported)); return group.finish(); } -bool Instance::save_surface(const rendering::SurfaceResource::Handle &surface, const synfig::String &filename) +bool Instance::save_surface(const rendering::SurfaceResource::Handle& surface, const synfig::String& filename) { rendering::SurfaceResource::LockRead<rendering::SurfaceSW> lock(surface); if (!lock) return false; return save_surface(lock->get_surface(), filename); } -bool Instance::save_surface(const synfig::Surface &surface, const synfig::String &filename) +bool Instance::save_surface(const synfig::Surface& surface, const synfig::String& filename) { if (surface.get_h() <= 0 || surface.get_w() <= 0) return false; @@ -340,7 +337,7 @@ } void -Instance::process_filename(const ProcessFilenamesParams ¶ms, const synfig::String &filename, synfig::String &out_filename) +Instance::process_filename(const ProcessFilenamesParams& params, const synfig::String& filename, synfig::String& out_filename) { String full_filename = CanvasFileNaming::make_full_filename(params.previous_canvas_filename, filename); std::map<String, String>::const_iterator i = params.processed_files.find(full_filename); @@ -378,7 +375,7 @@ } void -Instance::process_filenames(const ProcessFilenamesParams ¶ms, const synfig::NodeHandle &node, bool self) +Instance::process_filenames(const ProcessFilenamesParams& params, const synfig::NodeHandle& node, bool self) { if (!node || params.processed_nodes.count(node)) return; params.processed_nodes.insert(node); @@ -393,15 +390,12 @@ ValueBase value = value_node->get_value(); - if (self) - { - if (value.same_type_as(String())) - { + if (self) { + if (value.same_type_as(String())) { String filename = value.get(String()); String new_filename; process_filename(params, filename, new_filename); - if (filename != new_filename) - { + if (filename != new_filename) { params.processed_valuenodesvalue_node = filename; value_node->set_value(new_filename); } @@ -416,10 +410,9 @@ } // ValueNode_Animated - if (ValueNode_Animated::Handle animated = ValueNode_Animated::Handle::cast_dynamic(node)) - { - const WaypointList &waypoints = animated->waypoint_list(); - for(WaypointList::const_iterator i = waypoints.begin(); i != waypoints.end(); ++i) + if (ValueNode_Animated::Handle animated = ValueNode_Animated::Handle::cast_dynamic(node)) { + const WaypointList& waypoints = animated->waypoint_list(); + for (WaypointList::const_iterator i = waypoints.begin(); i != waypoints.end(); ++i) process_filenames(params, i->get_value_node(), self); return; } @@ -434,15 +427,14 @@ if (canvas->get_root() != params.canvas) return; // exported values - if (canvas->is_inline()) - { - const ValueNodeList &list = canvas->value_node_list(); - for(ValueNodeList::const_iterator i = list.begin(); i != list.end(); ++i) + if (canvas->is_inline()) { + const ValueNodeList& list = canvas->value_node_list(); + for (ValueNodeList::const_iterator i = list.begin(); i != list.end(); ++i) process_filenames(params, *i); } // layers - for(Canvas::const_iterator i = canvas->begin(); i != canvas->end(); ++i) + for (Canvas::const_iterator i = canvas->begin(); i != canvas->end(); ++i) process_filenames(params, *i); return; @@ -457,15 +449,14 @@ return; const ParamVocab vocab = layer->get_param_vocab(); - const Layer::DynamicParamList &dynamic_params = layer->dynamic_param_list(); - for(ParamVocab::const_iterator i = vocab.begin(); i != vocab.end(); ++i) + const Layer::DynamicParamList& dynamic_params = layer->dynamic_param_list(); + for (ParamVocab::const_iterator i = vocab.begin(); i != vocab.end(); ++i) { Layer::DynamicParamList::const_iterator j = dynamic_params.find(i->get_name()); ValueNode::Handle value_node = j == dynamic_params.end() ? ValueNode::Handle() : ValueNode::Handle(j->second); bool is_filename = i->get_hint() == "filename"; - if (value_node) - { + if (value_node) { process_filenames(params, value_node, is_filename); continue; } @@ -481,8 +472,7 @@ String filename = value.get(String()); String new_filename; process_filename(params, filename, new_filename); - if (filename != new_filename) - { + if (filename != new_filename) { params.processed_paramsstd::make_pair(layer, i->get_name()) = filename; layer->set_param(i->get_name(), new_filename); } @@ -499,7 +489,7 @@ return; const ParamVocab& vocab = linkable->get_children_vocab(); - for(ParamVocab::const_iterator i = vocab.begin(); i != vocab.end(); ++i) + for (ParamVocab::const_iterator i = vocab.begin(); i != vocab.end(); ++i) process_filenames(params, ValueNode::Handle(linkable->get_link(i->get_name())), i->get_hint() == "filename"); return; @@ -507,20 +497,20 @@ } void -Instance::process_filenames_undo(const ProcessFilenamesParams ¶ms) +Instance::process_filenames_undo(const ProcessFilenamesParams& params) { // restore layer params - for(std::map<std::pair<Layer::Handle, String>, String>::const_iterator i = params.processed_params.begin(); i != params.processed_params.end(); ++i) + for (std::map<std::pair<Layer::Handle, String>, String>::const_iterator i = params.processed_params.begin(); i != params.processed_params.end(); ++i) i->first.first->set_param(i->first.second, i->second); // restore value nodes - for(std::map<ValueNode_Const::Handle, String>::const_iterator i = params.processed_valuenodes.begin(); i != params.processed_valuenodes.end(); ++i) + for (std::map<ValueNode_Const::Handle, String>::const_iterator i = params.processed_valuenodes.begin(); i != params.processed_valuenodes.end(); ++i) i->first->set_value(i->second); } void -Instance::find_unsaved_layers(std::vector<synfig::Layer::Handle> &out_layers, const synfig::Canvas::Handle canvas) +Instance::find_unsaved_layers(std::vector<synfig::Layer::Handle>& out_layers, const synfig::Canvas::Handle canvas) { - for(Canvas::const_iterator i = canvas->begin(); i != canvas->end(); ++i) + for (Canvas::const_iterator i = canvas->begin(); i != canvas->end(); ++i) { if (Layer_PasteCanvas::Handle layer_pastecanvas = Layer_PasteCanvas::Handle::cast_dynamic(*i)) if (Canvas::Handle sub_canvas = layer_pastecanvas->get_sub_canvas()) @@ -538,7 +528,7 @@ } bool -Instance::save_layer(const synfig::Layer::Handle &layer) +Instance::save_layer(const synfig::Layer::Handle& layer) { if (Layer_Bitmap::Handle layer_bitmap = Layer_Bitmap::Handle::cast_dynamic(layer)) { @@ -546,8 +536,7 @@ && layer_bitmap->get_param_list().count("filename")) { ValueBase value = layer_bitmap->get_param("filename"); - if (value.same_type_as(String())) - { + if (value.same_type_as(String())) { String filename = value.get(String()); if (save_surface(layer_bitmap->rendering_surface, filename)) return true; @@ -565,7 +554,7 @@ { std::vector<Layer::Handle> layers; find_unsaved_layers(layers); - for(std::vector<Layer::Handle>::const_iterator i = layers.begin(); i != layers.end(); ++i) + for (std::vector<Layer::Handle>::const_iterator i = layers.begin(); i != layers.end(); ++i) save_layer(*i); } @@ -576,8 +565,7 @@ return true; FileSystemTemporary::Handle temporary_filesystem = FileSystemTemporary::Handle::cast_dynamic(get_canvas()->get_file_system()); - if (!temporary_filesystem) - { + if (!temporary_filesystem) { warning("Cannot backup, canvas was not attached to temporary file system: %s", get_file_name().c_str()); return false; } @@ -591,7 +579,7 @@ } bool -Instance::save_as(const synfig::String &file_name) +Instance::save_as(const synfig::String& file_name) { Canvas::Handle canvas = get_canvas(); @@ -610,14 +598,12 @@ { // new canvas filesystem FileSystem::Handle new_container = CanvasFileNaming::make_filesystem_container(new_canvas_filename, 0, true); - if (!new_container) - { + if (!new_container) { warning("Cannot create container: %s", new_canvas_filename.c_str()); return false; } new_canvas_filesystem = CanvasFileNaming::make_filesystem(new_container); - if (!new_canvas_filesystem) - { + if (!new_canvas_filesystem) { warning("Cannot create canvas filesystem for: %s", new_canvas_filename.c_str()); return false; } @@ -694,8 +680,7 @@ if (success) reset_action_count(); - if (success) - { + if (success) { signal_saved_(); signal_filename_changed_(); return true; @@ -718,10 +703,10 @@ void Instance::generate_new_name( - const Layer::Handle &layer, - String &out_description, - String &out_filename, - String &out_filename_param ) + const Layer::Handle& layer, + String& out_description, + String& out_filename, + String& out_filename_param ) { String filename; if (layer->get_param_list().count("filename")) {
View file
_service:obs_scm:synfig-1.5.4.obscpio/synfig-studio/src/synfigapp/instance.h -> _service:obs_scm:synfig-1.5.5.obscpio/synfig-studio/src/synfigapp/instance.h
Changed
@@ -103,7 +103,7 @@ std::list< synfig::Layer::Handle > layers_to_save; - bool import_external_canvas(synfig::Canvas::Handle canvas, std::map<synfig::Canvas*, synfig::Canvas::Handle> &imported); + bool import_external_canvas(synfig::Canvas::Handle canvas, std::map<synfig::Canvas*, synfig::Canvas::Handle>& imported); Action::Group::Handle import_external_canvases(); struct ProcessFilenamesParams @@ -122,9 +122,9 @@ ProcessFilenamesParams(): embed_files(), save_files() { } ProcessFilenamesParams( - const synfig::Canvas::Handle &canvas, - const synfig::FileSystem::Handle &previous_canvas_filesystem, - const synfig::String &previous_canvas_filename, + const synfig::Canvas::Handle& canvas, + const synfig::FileSystem::Handle& previous_canvas_filesystem, + const synfig::String& previous_canvas_filename, bool embed_files, bool save_files ): @@ -137,9 +137,9 @@ }; // embed and refine filenames used in layers and valuenodes in current instance - void process_filename(const ProcessFilenamesParams ¶ms, const synfig::String &filename, synfig::String &out_filename); - void process_filenames(const ProcessFilenamesParams ¶ms, const synfig::NodeHandle &node, bool self = false); - void process_filenames_undo(const ProcessFilenamesParams ¶ms); + void process_filename(const ProcessFilenamesParams& params, const synfig::String& filename, synfig::String& out_filename); + void process_filenames(const ProcessFilenamesParams& params, const synfig::NodeHandle& node, bool self = false); + void process_filenames_undo(const ProcessFilenamesParams& params); protected: Instance(synfig::Canvas::Handle, synfig::FileSystem::Handle container); @@ -151,53 +151,53 @@ public: ~Instance(); - void set_selection_manager(const etl::handle<SelectionManager> &sm) { assert(sm); selection_manager_=sm; } + void set_selection_manager(const etl::handle<SelectionManager>& sm) { assert(sm); selection_manager_=sm; } void unset_selection_manager() { selection_manager_=new NullSelectionManager(); } - const etl::handle<SelectionManager> &get_selection_manager() { return selection_manager_; } + const etl::handle<SelectionManager>& get_selection_manager() { return selection_manager_; } synfig::FileSystem::Handle get_container() const { return container_; }; - bool save_surface(const synfig::rendering::SurfaceResource::Handle &surface, const synfig::String &filename); - bool save_surface(const synfig::Surface &surface, const synfig::String &filename); - bool save_layer(const synfig::Layer::Handle &layer); + bool save_surface(const synfig::rendering::SurfaceResource::Handle& surface, const synfig::String& filename); + bool save_surface(const synfig::Surface& surface, const synfig::String& filename); + bool save_layer(const synfig::Layer::Handle& layer); void save_all_layers(); - void find_unsaved_layers(std::vector<synfig::Layer::Handle> &out_layers, const synfig::Canvas::Handle canvas); - void find_unsaved_layers(std::vector<synfig::Layer::Handle> &out_layers) + void find_unsaved_layers(std::vector<synfig::Layer::Handle>& out_layers, const synfig::Canvas::Handle canvas); + void find_unsaved_layers(std::vector<synfig::Layer::Handle>& out_layers) { find_unsaved_layers(out_layers, get_canvas()); } etl::handle<CanvasInterface> find_canvas_interface(synfig::Canvas::Handle canvas); const synfig::Canvas::Handle& get_canvas()const { return canvas_; } - void convert_animated_filenames(const synfig::Canvas::Handle &canvas, const synfig::String &old_path, const synfig::String &new_path); + void convert_animated_filenames(const synfig::Canvas::Handle& canvas, const synfig::String& old_path, const synfig::String& new_path); //! Saves the instance to filename_ bool save(); - bool save_as(const synfig::String &filename); + bool save_as(const synfig::String& filename); //! Saves the instance to current temporary container bool backup(bool save_even_if_unchanged = false); //! generate layer name (also known in code as 'description') - synfig::String generate_new_description(const synfig::Layer::Handle &layer); + synfig::String generate_new_description(const synfig::Layer::Handle& layer); //! create unique file name for an embedded image layer (if image filename is empty, description layer is used) void generate_new_name( - const synfig::Layer::Handle &layer, - synfig::String &out_description, - synfig::String &out_filename, - synfig::String &out_filename_param ); + const synfig::Layer::Handle& layer, + synfig::String& out_description, + synfig::String& out_filename, + synfig::String& out_filename_param ); public: // Interfaces to internal information sigc::signal<void>& signal_filename_changed() { return signal_filename_changed_; } sigc::signal<void>& signal_saved() { return signal_saved_; } - CanvasInterfaceList & canvas_interface_list() { return canvas_interface_list_; } - const CanvasInterfaceList & canvas_interface_list()const { return canvas_interface_list_; } + CanvasInterfaceList& canvas_interface_list() { return canvas_interface_list_; } + const CanvasInterfaceList& canvas_interface_list()const { return canvas_interface_list_; } synfig::String get_file_name()const; - void set_file_name(const synfig::String &name); + void set_file_name(const synfig::String& name); public:
View file
_service:obs_scm:synfig-1.5.4.obscpio/synfig-studio/src/synfigapp/vectorizer/centerlinetostrokes.cpp -> _service:obs_scm:synfig-1.5.5.obscpio/synfig-studio/src/synfigapp/vectorizer/centerlinetostrokes.cpp
Changed
@@ -704,7 +704,7 @@ KyL = (ellProd(a, y) / 15.0) + (ellProd(f, y) / 10.0); MxO = ((e * x) / 15.0) + (ellProd(f, x) / 10.0); - // Infine, ho il termine noto + // Finally, we have the known term l = synfig::Point(ellProd(IH, x) - HxL + ellProd(IM, x) - MxO, ellProd(IK, y) - KyL + ellProd(IN_, y) - NyO); M.m20 = -l0;
View file
_service:obs_scm:synfig.obsinfo
Changed
@@ -1,4 +1,4 @@ name: synfig -version: 1.5.4 -mtime: 1768734263 -commit: d8951f9c2a61308d5a54951d01c63102472d5ef1 +version: 1.5.5 +mtime: 1773566123 +commit: 79bf708e2483cba678fc93f0ecf48b2178263795
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.