summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 48a6868)
raw | patch | inline | side by side (parent: 48a6868)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Tue, 8 Jul 2008 20:18:44 +0000 (20:18 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Tue, 8 Jul 2008 20:18:44 +0000 (20:18 +0000) |
src/display/curve.cpp | patch | blob | history | |
src/display/curve.h | patch | blob | history | |
src/object-snapper.cpp | patch | blob | history | |
src/sp-image.cpp | patch | blob | history |
diff --git a/src/display/curve.cpp b/src/display/curve.cpp
index 68cb1c900a1c5294ea2760b41c6453ad0712ed12..c229ec28a533ebc5b9b2ff28c7a4b366d50bead3 100644 (file)
--- a/src/display/curve.cpp
+++ b/src/display/curve.cpp
#include <2geom/sbasis-geometric.h>
#include <2geom/sbasis-to-bezier.h>
#include "svg/svg.h"
#include <2geom/sbasis-geometric.h>
#include <2geom/sbasis-to-bezier.h>
#include "svg/svg.h"
+#include <2geom/point.h>
static unsigned sp_bpath_length(NArtBpath const bpath[]);
static bool sp_bpath_closed(NArtBpath const bpath[]);
static unsigned sp_bpath_length(NArtBpath const bpath[]);
static bool sp_bpath_closed(NArtBpath const bpath[]);
// * 2GEOMproof
SPCurve *
// * 2GEOMproof
SPCurve *
-SPCurve::new_from_rect(NR::Maybe<NR::Rect> const &rect)
+SPCurve::new_from_rect(Geom::Rect const &rect)
{
{
- g_return_val_if_fail(rect, NULL);
-
SPCurve *c = new SPCurve();
SPCurve *c = new SPCurve();
- NR::Point p = rect->corner(0);
+ NR::Point p = rect.corner(0);
c->moveto(p);
for (int i=3; i>=0; i--) {
c->moveto(p);
for (int i=3; i>=0; i--) {
- c->lineto(rect->corner(i));
+ c->lineto(rect.corner(i));
}
c->closepath_current();
}
c->closepath_current();
diff --git a/src/display/curve.h b/src/display/curve.h
index 39720e40195157e00e51630e75d57c79fc0167ef..6697987cafe9fd2cc48a7e41486f8a66cad05bf7 100644 (file)
--- a/src/display/curve.h
+++ b/src/display/curve.h
#include <glib/gslist.h>
#include <2geom/forward.h>
#include <glib/gslist.h>
#include <2geom/forward.h>
-#include <2geom/point.h>
#include "libnr/nr-forward.h"
#include "libnr/nr-rect.h"
#include "libnr/nr-forward.h"
#include "libnr/nr-rect.h"
SPCurve(Geom::PathVector const& pathv);
static SPCurve * new_from_bpath(NArtBpath *bpath);
static SPCurve * new_from_foreign_bpath(NArtBpath const *bpath);
SPCurve(Geom::PathVector const& pathv);
static SPCurve * new_from_bpath(NArtBpath *bpath);
static SPCurve * new_from_foreign_bpath(NArtBpath const *bpath);
- static SPCurve * new_from_rect(NR::Maybe<NR::Rect> const &rect);
+ static SPCurve * new_from_rect(Geom::Rect const &rect);
virtual ~SPCurve();
virtual ~SPCurve();
diff --git a/src/object-snapper.cpp b/src/object-snapper.cpp
index ef6c5fce26c55be8d1ad802037b488574670ace2..c928d43d37fba450a3a25276aa36ee4b031ea651 100644 (file)
--- a/src/object-snapper.cpp
+++ b/src/object-snapper.cpp
#include "libnr/nr-rect-ops.h"
#include "libnr/nr-point-fns.h"
#include "libnr/n-art-bpath-2geom.h"
#include "libnr/nr-rect-ops.h"
#include "libnr/nr-point-fns.h"
#include "libnr/n-art-bpath-2geom.h"
-#include "2geom/path-intersection.h"
+#include <2geom/path-intersection.h>
+#include <2geom/point.h>
+#include <2geom/rect.h>
#include "document.h"
#include "sp-namedview.h"
#include "sp-image.h"
#include "document.h"
#include "sp-namedview.h"
#include "sp-image.h"
NArtBpath const* Inkscape::ObjectSnapper::_getBorderBPath() const
{
NArtBpath const *border_bpath = NULL;
NArtBpath const* Inkscape::ObjectSnapper::_getBorderBPath() const
{
NArtBpath const *border_bpath = NULL;
- NR::Rect const border_rect = NR::Rect(NR::Point(0,0), NR::Point(sp_document_width(_named_view->document),sp_document_height(_named_view->document)));
+ Geom::Rect const border_rect = Geom::Rect(Geom::Point(0,0), Geom::Point(sp_document_width(_named_view->document),sp_document_height(_named_view->document)));
SPCurve const *border_curve = SPCurve::new_from_rect(border_rect);
if (border_curve) {
border_bpath = SP_CURVE_BPATH(border_curve);
SPCurve const *border_curve = SPCurve::new_from_rect(border_rect);
if (border_curve) {
border_bpath = SP_CURVE_BPATH(border_curve);
diff --git a/src/sp-image.cpp b/src/sp-image.cpp
index f2f2265ea5b54d754b241e284321f8e5639aa8f1..2dc3bfb278a02c0f8009f5711239dd305cd9de3b 100644 (file)
--- a/src/sp-image.cpp
+++ b/src/sp-image.cpp
#include <libnr/nr-matrix-ops.h>
#include <libnr/nr-translate-matrix-ops.h>
#include <libnr/nr-scale-translate-ops.h>
#include <libnr/nr-matrix-ops.h>
#include <libnr/nr-translate-matrix-ops.h>
#include <libnr/nr-scale-translate-ops.h>
+#include <libnr/nr-convert2geom.h>
+#include <2geom/rect.h>
//#define GDK_PIXBUF_ENABLE_BACKEND 1
//#include <gdk-pixbuf/gdk-pixbuf-io.h>
#include "display/nr-arena-image.h"
//#define GDK_PIXBUF_ENABLE_BACKEND 1
//#include <gdk-pixbuf/gdk-pixbuf-io.h>
#include "display/nr-arena-image.h"
NRRect rect;
sp_image_bbox(image, &rect, NR::identity(), 0);
NRRect rect;
sp_image_bbox(image, &rect, NR::identity(), 0);
- NR::Maybe<NR::Rect> rect2 = rect.upgrade();
- SPCurve *c = SPCurve::new_from_rect(rect2);
+ Geom::Rect rect2 = to_2geom(*rect.upgrade());
+ SPCurve *c = SPCurve::new_from_rect(rect2);
if (image->curve) {
image->curve = image->curve->unref();
if (image->curve) {
image->curve = image->curve->unref();