Commit 229008a1 authored by Nathan Lee's avatar Nathan Lee

Set filter region on handle move (even if unset)

Writes out to filter's svg repr when knot moved.
This affects all knots on a filtered object.
Fixes #749

Also moves knots smoothly when filter region unset.
Fixes #478

(cherry picked from commit a2d7f039)
parent ba04d703
Pipeline #144370936 passed with stages
in 90 minutes and 17 seconds
......@@ -398,6 +398,20 @@ void FilterKnotHolderEntity::knot_set(Geom::Point const &p, Geom::Point const &o
if(!filter) return;
Geom::OptRect orig_bbox = item->visualBounds();
std::unique_ptr<Geom::Rect> new_bbox(_topleft ? new Geom::Rect(p,orig_bbox->max()) : new Geom::Rect(orig_bbox->min(), p));
if (!filter->width._set) {
filter->width.set(SVGLength::PERCENT, 1.2);
}
if (!filter->height._set) {
filter->height.set(SVGLength::PERCENT, 1.2);
}
if (!filter->x._set) {
filter->x.set(SVGLength::PERCENT, -0.1);
}
if (!filter->y._set) {
filter->y.set(SVGLength::PERCENT, -0.1);
}
if(_topleft) {
float x_a = filter->width.computed;
float y_a = filter->height.computed;
......
......@@ -312,6 +312,11 @@ KnotHolder::knot_ungrabbed_handler(SPKnot *knot, guint state)
}
}
SPFilter *filter = (object->style) ? dynamic_cast<SPFilter *>(object->style->getFilter()) : nullptr;
if (filter) {
filter->updateRepr();
}
unsigned int object_verb = SP_VERB_NONE;
// TODO extract duplicated blocks:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment