summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bd80360)
raw | patch | inline | side by side (parent: bd80360)
author | Krzysztof Kosiński <tweenk.pl@gmail.com> | |
Sun, 7 Feb 2010 01:22:44 +0000 (02:22 +0100) | ||
committer | Krzysztof Kosiński <tweenk.pl@gmail.com> | |
Sun, 7 Feb 2010 01:22:44 +0000 (02:22 +0100) |
src/2geom/hvlinesegment.h | patch | blob | history | |
src/2geom/path.cpp | patch | blob | history | |
src/gradient-drag.cpp | patch | blob | history |
index ac91ec80a73909b6511d9d8a8fd29870fb882e6e..6c42b06aa4f7b199aa673a604de72a66b4595cbe 100644 (file)
{
Point ip = initialPoint() * m;
Point ep = finalPoint() * m;
- if (m.onlyScaleAndTranslation()) {
+ if (ip[Y] == ep[Y]) {
return new HLineSegment(ip[X], ep[X], ip[Y]);
} else {
return new LineSegment(ip, ep);
{
Point ip = initialPoint() * m;
Point ep = finalPoint() * m;
- if (m.onlyScaleAndTranslation()) {
+ if (ip[X] == ep[X]) {
return new VLineSegment(ip[X], ip[Y], ep[Y]);
} else {
return new LineSegment(ip, ep);
diff --git a/src/2geom/path.cpp b/src/2geom/path.cpp
index 88c7a99b9df9af99c8d1e3112cfb8e03c7825700..05a69d616371e2870a1d666697be4173bdfc5d4b 100644 (file)
--- a/src/2geom/path.cpp
+++ b/src/2geom/path.cpp
}
prev = (*it)->finalPoint();
}
- for ( int i = 0 ; i < 2 ; ++i ) {
- final_->setPoint(i, (*final_)[i] * m);
+ if (closed_) {
+ Geom::Point pt = front().initialPoint();
+ if (size_open() > 0) {
+ Curve *l = const_cast<Curve*>((get_curves().end() - 2)->get());
+ l->setFinal(pt);
+ }
+ final_->setInitial(pt);
+ final_->setFinal(pt);
+ } else {
+ final_->setInitial(back().finalPoint());
+ final_->setFinal(front().initialPoint());
}
if (get_curves().size() > 1) {
if ( front().initialPoint() != initialPoint() || back().finalPoint() != finalPoint() ) {
diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp
index 5facfefd0d13c0f442a18d82ff630fd17ce1d7aa..5be435a647764a0529d1f1c1b27bc65763833e80 100644 (file)
--- a/src/gradient-drag.cpp
+++ b/src/gradient-drag.cpp
@@ -1154,7 +1154,10 @@ Moves this dragger to the point of the given draggable, acting upon all other dr
void
GrDragger::moveThisToDraggable (SPItem *item, gint point_type, gint point_i, bool fill_or_stroke, bool write_repr)
{
- this->point = sp_item_gradient_get_coords (item, point_type, point_i, fill_or_stroke);
+ GrDraggable *dr_first = (GrDraggable *) this->draggables->data;
+ if (!dr_first) return;
+
+ this->point = sp_item_gradient_get_coords (dr_first->item, dr_first->point_type, dr_first->point_i, dr_first->fill_or_stroke);
this->point_original = this->point;
sp_knot_moveto (this->knot, this->point);