summaryrefslogtreecommitdiffstats
path: root/src/dialogs/clonetiler.cpp
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2006-10-23 01:47:05 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2006-10-23 01:47:05 +0000
commit39bb73693621f05232406c497d6dc5e4b696a178 (patch)
tree0b2807f52f111539a54869ff306ac4de476be0b6 /src/dialogs/clonetiler.cpp
parentsimplify by using the new API (diff)
downloadinkscape-39bb73693621f05232406c497d6dc5e4b696a178.tar.gz
inkscape-39bb73693621f05232406c497d6dc5e4b696a178.zip
fix calculating the blur radius, use the new API
(bzr r1841)
Diffstat (limited to 'src/dialogs/clonetiler.cpp')
-rw-r--r--src/dialogs/clonetiler.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/dialogs/clonetiler.cpp b/src/dialogs/clonetiler.cpp
index f3cc9b4e0..2bed7b399 100644
--- a/src/dialogs/clonetiler.cpp
+++ b/src/dialogs/clonetiler.cpp
@@ -1090,7 +1090,7 @@ clonetiler_apply (GtkWidget *widget, void *)
NR::Point cur = NR::Point (0, 0);
NR::Rect bbox_original = NR::Rect (NR::Point (c[NR::X] - w/2, c[NR::Y] - h/2), NR::Point (c[NR::X] + w/2, c[NR::Y] + h/2));
- double diag_original = sqrt(w*w + h*h);
+ double perimeter_original = (w + h)/4;
for (int x = 0;
fillrect?
@@ -1299,12 +1299,12 @@ clonetiler_apply (GtkWidget *widget, void *)
if (blur > 0.0) {
SPObject *clone_object = sp_desktop_document(desktop)->getObjectByRepr(clone);
- double diag = diag_original * t.expansion();
- double radius = blur * diag;
+ double perimeter = perimeter_original * t.expansion();
+ double radius = blur * perimeter;
// it's hard to figure out exact width/height of the tile without having an object
// that we can take bbox of; however here we only need a lower bound so that blur
- // margins are not too small, and diag/2 should work
- SPFilter *constructed = new_filter_gaussian_blur(sp_desktop_document(desktop), radius, diag/2, diag/2);
+ // margins are not too small, and the perimeter should work
+ SPFilter *constructed = new_filter_gaussian_blur(sp_desktop_document(desktop), radius, t.expansion(), perimeter, perimeter);
sp_style_set_property_url (clone_object, "filter", SP_OBJECT(constructed), false);
}