diff --git a/src/sp-offset.cpp b/src/sp-offset.cpp
index c91b0ad0dcacfcbca7ee6e30b5e2d24183e35de9..ae0f7bf19ea48bebe09cc7ccf91f12f6958aff74 100644 (file)
--- a/src/sp-offset.cpp
+++ b/src/sp-offset.cpp
static void sp_offset_release (SPObject * object);
static gchar *sp_offset_description (SPItem * item);
-static void sp_offset_snappoints(SPItem const *item, SnapPointsIter p, Inkscape::SnapPreferences const *snapprefs);
+static void sp_offset_snappoints(SPItem const *item, bool const target, SnapPointsWithType &p, Inkscape::SnapPreferences const *snapprefs);
static void sp_offset_set_shape (SPShape * shape);
static void refresh_offset_source(SPOffset* offset);
theRes->ConvertToForme (orig, 1, originaux);
SPItem *item = shape;
- boost::optional<Geom::Rect> bbox = sp_item_bbox_desktop (item);
- if ( bbox && !bbox->isEmpty() ) {
+ Geom::OptRect bbox = sp_item_bbox_desktop (item);
+ if ( bbox ) {
gdouble size = L2(bbox->dimensions());
- gdouble const exp = NR::expansion(item->transform);
+ gdouble const exp = item->transform.descrim();
if (exp != 0)
size /= exp;
orig->Coalesce (size * 0.001);
/**
* Virtual snappoints function.
*/
-static void sp_offset_snappoints(SPItem const *item, SnapPointsIter p, Inkscape::SnapPreferences const *snapprefs)
+static void sp_offset_snappoints(SPItem const *item, bool const target, SnapPointsWithType &p, Inkscape::SnapPreferences const *snapprefs)
{
if (((SPItemClass *) parent_class)->snappoints) {
- ((SPItemClass *) parent_class)->snappoints (item, p, snapprefs);
+ ((SPItemClass *) parent_class)->snappoints (item, target, p, snapprefs);
}
}
@@ -746,9 +746,9 @@ static void sp_offset_snappoints(SPItem const *item, SnapPointsIter p, Inkscape:
* -- njh
*/
bool
-vectors_are_clockwise (NR::Point A, NR::Point B, NR::Point C)
+vectors_are_clockwise (Geom::Point A, Geom::Point B, Geom::Point C)
{
- using NR::rot90;
+ using Geom::rot90;
double ab_s = dot(A, rot90(B));
double ab_c = dot(A, B);
double bc_s = dot(B, rot90(C));
* 'px inside source'.
*/
double
-sp_offset_distance_to_original (SPOffset * offset, NR::Point px)
+sp_offset_distance_to_original (SPOffset * offset, Geom::Point px)
{
if (offset == NULL || offset->originalPath == NULL
|| ((Path *) offset->originalPath)->descr_cmd.size() <= 1)
{
if (theRes->getPoint(i).totalDegree() > 0)
{
- NR::Point nx = theRes->getPoint(i).x;
- NR::Point nxpx = px-nx;
+ Geom::Point nx = theRes->getPoint(i).x;
+ Geom::Point nxpx = px-nx;
double ndist = sqrt (dot(nxpx,nxpx));
if (ptSet == false || fabs (ndist) < fabs (ptDist))
{
// we have a new minimum distance
// now we need to wheck if px is inside or outside (for the sign)
- nx = px - theRes->getPoint(i).x;
+ nx = px - to_2geom(theRes->getPoint(i).x);
double nlen = sqrt (dot(nx , nx));
nx /= nlen;
int pb, cb, fb;
do
{
// one angle
- NR::Point prx, nex;
+ Geom::Point prx, nex;
prx = theRes->getEdge(pb).dx;
nlen = sqrt (dot(prx, prx));
prx /= nlen;
// loop over the edges to try to improve the distance
for (int i = 0; i < theRes->numberOfEdges(); i++)
{
- NR::Point sx = theRes->getPoint(theRes->getEdge(i).st).x;
- NR::Point ex = theRes->getPoint(theRes->getEdge(i).en).x;
- NR::Point nx = ex - sx;
+ Geom::Point sx = theRes->getPoint(theRes->getEdge(i).st).x;
+ Geom::Point ex = theRes->getPoint(theRes->getEdge(i).en).x;
+ Geom::Point nx = ex - sx;
double len = sqrt (dot(nx,nx));
if (len > 0.0001)
{
- NR::Point pxsx=px-sx;
+ Geom::Point pxsx=px-sx;
double ab = dot(nx,pxsx);
if (ab > 0 && ab < len * len)
{