summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2014-07-23 22:58:41 +0000
committerJohan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl>2014-07-23 22:58:41 +0000
commitbc1648c615a36a3b1e302f8ee5bca1c35b223db7 (patch)
tree280cde58f999976f5d5508eae47df2f2fa1fe188 /src
parentPartly reverted r13460. (diff)
downloadinkscape-bc1648c615a36a3b1e302f8ee5bca1c35b223db7.tar.gz
inkscape-bc1648c615a36a3b1e302f8ee5bca1c35b223db7.zip
Fix crash bug with cloned item with gradient. The fix does not solve the root cause, it only fixes the symptom.
Fixed bugs: - https://launchpad.net/bugs/453067 (bzr r13465)
Diffstat (limited to 'src')
-rw-r--r--src/gradient-chemistry.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gradient-chemistry.cpp b/src/gradient-chemistry.cpp
index 89b7968fc..27f4d7a98 100644
--- a/src/gradient-chemistry.cpp
+++ b/src/gradient-chemistry.cpp
@@ -1296,6 +1296,10 @@ Geom::Point getGradientCoords(SPItem *item, GrPointType point_type, guint point_
break;
case POINT_LG_MID:
{
+ if (lg->vector.stops.size() < point_i) {
+ g_message("POINT_LG_MID bug trigger, see LP bug #453067");
+ break;
+ }
gdouble offset = lg->vector.stops.at(point_i).offset;
p = (1-offset) * Geom::Point(lg->x1.computed, lg->y1.computed) + offset * Geom::Point(lg->x2.computed, lg->y2.computed);
}
@@ -1321,12 +1325,20 @@ Geom::Point getGradientCoords(SPItem *item, GrPointType point_type, guint point_
break;
case POINT_RG_MID1:
{
+ if (rg->vector.stops.size() < point_i) {
+ g_message("POINT_RG_MID1 bug trigger, see LP bug #453067");
+ break;
+ }
gdouble offset = rg->vector.stops.at(point_i).offset;
p = (1-offset) * Geom::Point (rg->cx.computed, rg->cy.computed) + offset * Geom::Point(rg->cx.computed + rg->r.computed, rg->cy.computed);
}
break;
case POINT_RG_MID2:
{
+ if (rg->vector.stops.size() < point_i) {
+ g_message("POINT_RG_MID2 bug trigger, see LP bug #453067");
+ break;
+ }
gdouble offset = rg->vector.stops.at(point_i).offset;
p = (1-offset) * Geom::Point (rg->cx.computed, rg->cy.computed) + offset * Geom::Point(rg->cx.computed, rg->cy.computed - rg->r.computed);
}