diff options
| author | Maximilian Albert <maximilian.albert@gmail.com> | 2008-09-18 17:48:42 +0000 |
|---|---|---|
| committer | cilix42 <cilix42@users.sourceforge.net> | 2008-09-18 17:48:42 +0000 |
| commit | 07a2c5b0db916ac9e5dee3bcbafcb12d8e767fa8 (patch) | |
| tree | 3a4c8c7f4f8de2878adbe5eabaf75460d35b8bcb /src/eraser-context.cpp | |
| parent | NR ==> Geom conversion in sp-canvas (diff) | |
| download | inkscape-07a2c5b0db916ac9e5dee3bcbafcb12d8e767fa8.tar.gz inkscape-07a2c5b0db916ac9e5dee3bcbafcb12d8e767fa8.zip | |
Next roud of NR ==> Geom conversion
(bzr r6839)
Diffstat (limited to 'src/eraser-context.cpp')
| -rw-r--r-- | src/eraser-context.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/eraser-context.cpp b/src/eraser-context.cpp index 86d5e66dc..382a50edc 100644 --- a/src/eraser-context.cpp +++ b/src/eraser-context.cpp @@ -231,18 +231,18 @@ flerp(double f0, double f1, double p) static Geom::Point sp_eraser_get_npoint(SPEraserContext const *dc, Geom::Point v) { - NR::Rect drect = SP_EVENT_CONTEXT(dc)->desktop->get_display_area(); - double const max = MAX ( drect.dimensions()[NR::X], drect.dimensions()[NR::Y] ); - return Geom::Point(( v[NR::X] - drect.min()[NR::X] ) / max, ( v[NR::Y] - drect.min()[NR::Y] ) / max); + Geom::Rect drect = SP_EVENT_CONTEXT(dc)->desktop->get_display_area(); + double const max = MAX ( drect.dimensions()[Geom::X], drect.dimensions()[Geom::Y] ); + return Geom::Point(( v[Geom::X] - drect.min()[Geom::X] ) / max, ( v[Geom::Y] - drect.min()[Geom::Y] ) / max); } /* Get view point */ static Geom::Point sp_eraser_get_vpoint(SPEraserContext const *dc, Geom::Point n) { - NR::Rect drect = SP_EVENT_CONTEXT(dc)->desktop->get_display_area(); - double const max = MAX ( drect.dimensions()[NR::X], drect.dimensions()[NR::Y] ); - return Geom::Point(n[NR::X] * max + drect.min()[NR::X], n[NR::Y] * max + drect.min()[NR::Y]); + Geom::Rect drect = SP_EVENT_CONTEXT(dc)->desktop->get_display_area(); + double const max = MAX ( drect.dimensions()[Geom::X], drect.dimensions()[Geom::Y] ); + return Geom::Point(n[Geom::X] * max + drect.min()[Geom::X], n[Geom::Y] * max + drect.min()[Geom::Y]); } static void @@ -555,8 +555,6 @@ sp_eraser_context_root_handler(SPEventContext *event_context, if (dc->dragging && event->button.button == 1 && !event_context->space_panning) { dc->dragging = FALSE; - boost::optional<NR::Rect> const b = Inkscape::Rubberband::get(desktop)->getRectangle(); - sp_eraser_apply(dc, motion_dt); /* Remove all temporary line segments */ @@ -741,8 +739,8 @@ set_to_accumulated(SPEraserContext *dc) Inkscape::XML::Document *xml_doc = sp_document_repr_doc(desktop->doc()); SPItem* acid = SP_ITEM(desktop->doc()->getObjectByRepr(dc->repr)); - boost::optional<NR::Rect> eraserBbox = acid->getBounds(NR::identity()); - NR::Rect bounds = (*eraserBbox) * desktop->doc2dt(); + boost::optional<Geom::Rect> eraserBbox = to_2geom(acid->getBounds(Geom::identity())); + Geom::Rect bounds = (*eraserBbox) * desktop->doc2dt(); std::vector<SPItem*> remainingItems; GSList* toWorkOn = 0; if (selection->isEmpty()) { @@ -763,7 +761,7 @@ set_to_accumulated(SPEraserContext *dc) for (GSList *i = toWorkOn ; i ; i = i->next ) { SPItem *item = SP_ITEM(i->data); if ( eraserMode ) { - boost::optional<NR::Rect> bbox = item->getBounds(NR::identity()); + boost::optional<Geom::Rect> bbox = to_2geom(item->getBounds(Geom::identity())); if (bbox && bbox->intersects(*eraserBbox)) { Inkscape::XML::Node* dup = dc->repr->duplicate(xml_doc); dc->repr->parent()->appendChild(dup); @@ -911,7 +909,7 @@ fit_and_split(SPEraserContext *dc, gboolean release) { SPDesktop *desktop = SP_EVENT_CONTEXT(dc)->desktop; - double const tolerance_sq = square( NR::expansion(desktop->w2d()) * TOLERANCE_ERASER ); + double const tolerance_sq = square( desktop->w2d().descrim() * TOLERANCE_ERASER ); #ifdef ERASER_VERBOSE g_print("[F&S:R=%c]", release?'T':'F'); |
