summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 24f9f93)
raw | patch | inline | side by side (parent: 24f9f93)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Tue, 3 Mar 2009 21:51:55 +0000 (21:51 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Tue, 3 Mar 2009 21:51:55 +0000 (21:51 +0000) |
src/nodepath.cpp | patch | blob | history | |
src/sp-rect.cpp | patch | blob | history | |
src/sp-rect.h | patch | blob | history |
diff --git a/src/nodepath.cpp b/src/nodepath.cpp
index dfd06b660bf5b6c3cf8375ec73faa9ecf9f24fe2..a880baba26e175c59d61162c2b2a0e5d34f97046 100644 (file)
--- a/src/nodepath.cpp
+++ b/src/nodepath.cpp
#include "preferences.h"
#include "sp-metrics.h"
#include "sp-path.h"
+#include "sp-rect.h"
#include "libnr/nr-matrix-ops.h"
#include "svg/svg.h"
#include "verbs.h"
SPCurve *curve = NULL;
if (SP_IS_PATH(item)) {
curve = sp_path_get_curve_for_edit(SP_PATH(item));
+ } else if (SP_IS_RECT(item)) {
+ Geom::Rect rect = sp_rect_get_rect(SP_RECT(item));
+ curve = SPCurve::new_from_rect(rect);
} else {
g_warning ("-----> sp_nodepath_generate_helperpath(SPDesktop *desktop, SPItem *item): TODO: generate the helper path for this item type!\n");
return NULL;
diff --git a/src/sp-rect.cpp b/src/sp-rect.cpp
index f59a02853dfcfc0e549ace1c8a06ad09bccf91d6..aa026abb3eab890ab17824a6b3a06fd275de0661 100644 (file)
--- a/src/sp-rect.cpp
+++ b/src/sp-rect.cpp
#include <display/curve.h>
#include <libnr/nr-matrix-ops.h>
#include <libnr/nr-matrix-fns.h>
+#include <2geom/rect.h>
#include "inkscape.h"
#include "document.h"
SP_ITEM(rect)->transform);
}
+Geom::Rect
+sp_rect_get_rect (SPRect *rect)
+{
+ Geom::Point p0 = Geom::Point(rect->x.computed, rect->y.computed);
+ Geom::Point p2 = Geom::Point(rect->x.computed + rect->width.computed, rect->y.computed + rect->height.computed);
+ return Geom::Rect(p0, p2);
+}
+
void
sp_rect_compensate_rxry(SPRect *rect, Geom::Matrix xform)
{
diff --git a/src/sp-rect.h b/src/sp-rect.h
index 5c6fafab542c2c9cdc4f1841fd0ef1502513be43..9a97bc2173e025779bd9b6a53bf55905e6e3eff8 100644 (file)
--- a/src/sp-rect.h
+++ b/src/sp-rect.h
#include "svg/svg-length.h"
#include "sp-shape.h"
+#include <2geom/forward.h>
void sp_rect_set_visible_ry (SPRect *rect, gdouble ry);
gdouble sp_rect_get_visible_rx (SPRect *rect);
gdouble sp_rect_get_visible_ry (SPRect *rect);
+Geom::Rect sp_rect_get_rect (SPRect *rect);
void sp_rect_set_visible_width (SPRect *rect, gdouble rx);
void sp_rect_set_visible_height (SPRect *rect, gdouble ry);