From 2c020c360b11fbe8c3709322558ddc592e5e9ca3 Mon Sep 17 00:00:00 2001 From: buliabyak Date: Mon, 23 Oct 2006 01:47:05 +0000 Subject: [PATCH] fix calculating the blur radius, use the new API --- src/dialogs/clonetiler.cpp | 10 +++++----- 1 file 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); } -- 2.30.2