From cb0c46c9678889ce05dedae3ad2569435c7bb969 Mon Sep 17 00:00:00 2001 From: Ben Scholzen 'DASPRiD Date: Wed, 20 May 2015 17:51:48 +0200 Subject: Use sane constant for min and max values in LPE dialogs (bzr r14163.1.2) --- src/live_effects/parameter/parameter.cpp | 7 ------- src/live_effects/parameter/parameter.h | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/live_effects') diff --git a/src/live_effects/parameter/parameter.cpp b/src/live_effects/parameter/parameter.cpp index beb750404..527bc06fe 100644 --- a/src/live_effects/parameter/parameter.cpp +++ b/src/live_effects/parameter/parameter.cpp @@ -42,13 +42,6 @@ Parameter::param_write_to_repr(const char * svgd) param_effect->getRepr()->setAttribute(param_key.c_str(), svgd); } -// In gtk2, this wasn't an issue; we could toss around -// G_MAXDOUBLE and not worry about size allocations. But -// in gtk3, it is an issue: it allocates widget size for the maxmium -// value you pass to it, leading to some insane lengths. -// If you need this to be more, please be conservative about it. -const double SCALARPARAM_G_MAXDOUBLE = 10000000000.0; // TODO fixme: using an arbitrary large number as a magic value seems fragile. - void Parameter::write_to_SVG(void) { gchar * str = param_getSVGValue(); diff --git a/src/live_effects/parameter/parameter.h b/src/live_effects/parameter/parameter.h index 2e6cae49f..cc2c4f3d6 100644 --- a/src/live_effects/parameter/parameter.h +++ b/src/live_effects/parameter/parameter.h @@ -13,6 +13,13 @@ #include <2geom/forward.h> #include <2geom/pathvector.h> +// In gtk2, this wasn't an issue; we could toss around +// G_MAXDOUBLE and not worry about size allocations. But +// in gtk3, it is an issue: it allocates widget size for the maxmium +// value you pass to it, leading to some insane lengths. +// If you need this to be more, please be conservative about it. +const double SCALARPARAM_G_MAXDOUBLE = 10000000000.0; // TODO fixme: using an arbitrary large number as a magic value seems fragile. + class KnotHolder; class SPLPEItem; class SPDesktop; -- cgit v1.2.3 From 8d4ad16f759312fc28024de1df745888999392a5 Mon Sep 17 00:00:00 2001 From: Ben Scholzen 'DASPRiD Date: Mon, 25 May 2015 16:41:32 +0200 Subject: Fix taper stroke path generation (bzr r14172.1.1) --- src/live_effects/lpe-taperstroke.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/live_effects') diff --git a/src/live_effects/lpe-taperstroke.cpp b/src/live_effects/lpe-taperstroke.cpp index 451810d04..1f2c3c79e 100644 --- a/src/live_effects/lpe-taperstroke.cpp +++ b/src/live_effects/lpe-taperstroke.cpp @@ -275,7 +275,7 @@ Geom::PathVector LPETaperStroke::doEffect_path(Geom::PathVector const& path_in) pat_str << "M 1,0 C " << 1 - (double)smoothing << ",0 0,0.5 0,0.5 0,0.5 " << 1 - (double)smoothing << ",1 1,1"; pat_vec = sp_svg_read_pathv(pat_str.str().c_str()); - pwd2.concat(stretch_along(pathv_out[0].toPwSb(), pat_vec[0], -fabs(line_width))); + pwd2.concat(stretch_along(pathv_out[0].toPwSb(), pat_vec[0], fabs(line_width))); throwaway_path = Geom::path_from_piecewise(pwd2, LPE_CONVERSION_TOLERANCE)[0]; real_path.append(throwaway_path); @@ -304,7 +304,7 @@ Geom::PathVector LPETaperStroke::doEffect_path(Geom::PathVector const& path_in) pat_vec = sp_svg_read_pathv(pat_str_1.str().c_str()); pwd2 = Piecewise >(); - pwd2.concat(stretch_along(pathv_out[2].toPwSb(), pat_vec[0], -fabs(line_width))); + pwd2.concat(stretch_along(pathv_out[2].toPwSb(), pat_vec[0], fabs(line_width))); throwaway_path = Geom::path_from_piecewise(pwd2, LPE_CONVERSION_TOLERANCE)[0]; if (!Geom::are_near(real_path.finalPoint(), throwaway_path.initialPoint()) && real_path.size() >= 1) { -- cgit v1.2.3 From dd0a71ebdfaea505a14acedcc81f7386666be8fe Mon Sep 17 00:00:00 2001 From: Ben Scholzen 'DASPRiD Date: Wed, 27 May 2015 21:42:16 +0200 Subject: Write line_width back to SVG after initially setting it on jointype and taperstroke LPE (bzr r14178.1.1) --- src/live_effects/lpe-jointype.cpp | 1 + src/live_effects/lpe-taperstroke.cpp | 1 + 2 files changed, 2 insertions(+) (limited to 'src/live_effects') diff --git a/src/live_effects/lpe-jointype.cpp b/src/live_effects/lpe-jointype.cpp index 0111a0f99..c6a08d336 100644 --- a/src/live_effects/lpe-jointype.cpp +++ b/src/live_effects/lpe-jointype.cpp @@ -110,6 +110,7 @@ void LPEJoinType::doOnApply(SPLPEItem const* lpeitem) sp_repr_css_attr_unref (css); line_width.param_set_value(width); + line_width.write_to_SVG(); } } diff --git a/src/live_effects/lpe-taperstroke.cpp b/src/live_effects/lpe-taperstroke.cpp index 1f2c3c79e..5765febbd 100644 --- a/src/live_effects/lpe-taperstroke.cpp +++ b/src/live_effects/lpe-taperstroke.cpp @@ -126,6 +126,7 @@ void LPETaperStroke::doOnApply(SPLPEItem const* lpeitem) sp_repr_css_attr_unref (css); line_width.param_set_value(width); + line_width.write_to_SVG(); } else { printf("WARNING: It only makes sense to apply Taper stroke to paths (not groups).\n"); } -- cgit v1.2.3 From f914c2572f0e73cba795fb11047cfed056e06616 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Thu, 25 Jun 2015 18:08:54 +0200 Subject: Fix for the bug 1468396 Fixed bugs: - https://launchpad.net/bugs/1468396 (bzr r14217) --- src/live_effects/parameter/filletchamferpointarray.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/live_effects') diff --git a/src/live_effects/parameter/filletchamferpointarray.cpp b/src/live_effects/parameter/filletchamferpointarray.cpp index 10ded4d9f..c469b5fdd 100644 --- a/src/live_effects/parameter/filletchamferpointarray.cpp +++ b/src/live_effects/parameter/filletchamferpointarray.cpp @@ -491,6 +491,13 @@ std::vector FilletChamferPointArrayParam::get_times(int index, std::vect curve_it1 = subpaths[positions.first][positions.second].duplicate(); Coord it1_length = (*curve_it1).length(tolerance); double time_it1, time_it2, time_it1_B, intpart; + if(_vector.size() <= index){ + std::vector out; + out.push_back(0); + out.push_back(1); + out.push_back(0); + return out; + } time_it1 = modf(to_time(index, _vector[index][X]), &intpart); if (_vector[index][Y] == 0) { time_it1 = 0; -- cgit v1.2.3