~centralelyon2010/inkscape/imagelinks2

« back to all changes in this revision

Viewing changes to src/dyna-draw-context.cpp

  • Committer: cilix42
  • Date: 2008-09-18 17:48:42 UTC
  • Revision ID: cilix42@users.sourceforge.net-20080918174842-1ad33a7d7gqhv2hq
Next roud of NR ==> Geom conversion

Show diffs side-by-side

added added

removed removed

Lines of Context:
273
273
static Geom::Point
274
274
sp_dyna_draw_get_npoint(SPDynaDrawContext const *dc, Geom::Point v)
275
275
{
276
 
    NR::Rect drect = SP_EVENT_CONTEXT(dc)->desktop->get_display_area();
277
 
    double const max = MAX ( drect.dimensions()[NR::X], drect.dimensions()[NR::Y] );
278
 
    return Geom::Point(( v[NR::X] - drect.min()[NR::X] ) / max,  ( v[NR::Y] - drect.min()[NR::Y] ) / max);
 
276
    Geom::Rect drect = SP_EVENT_CONTEXT(dc)->desktop->get_display_area();
 
277
    double const max = MAX ( drect.dimensions()[Geom::X], drect.dimensions()[Geom::Y] );
 
278
    return Geom::Point(( v[Geom::X] - drect.min()[Geom::X] ) / max,  ( v[Geom::Y] - drect.min()[Geom::Y] ) / max);
279
279
}
280
280
 
281
281
/* Get view point */
282
282
static Geom::Point
283
283
sp_dyna_draw_get_vpoint(SPDynaDrawContext const *dc, Geom::Point n)
284
284
{
285
 
    NR::Rect drect = SP_EVENT_CONTEXT(dc)->desktop->get_display_area();
286
 
    double const max = MAX ( drect.dimensions()[NR::X], drect.dimensions()[NR::Y] );
287
 
    return Geom::Point(n[NR::X] * max + drect.min()[NR::X], n[NR::Y] * max + drect.min()[NR::Y]);
 
285
    Geom::Rect drect = SP_EVENT_CONTEXT(dc)->desktop->get_display_area();
 
286
    double const max = MAX ( drect.dimensions()[Geom::X], drect.dimensions()[Geom::Y] );
 
287
    return Geom::Point(n[Geom::X] * max + drect.min()[Geom::X], n[Geom::Y] * max + drect.min()[Geom::Y]);
288
288
}
289
289
 
290
290
static void
1095
1095
{
1096
1096
    SPDesktop *desktop = SP_EVENT_CONTEXT(dc)->desktop;
1097
1097
 
1098
 
    double const tolerance_sq = square( NR::expansion(desktop->w2d()) * TOLERANCE_CALLIGRAPHIC );
 
1098
    double const tolerance_sq = square( desktop->w2d().descrim() * TOLERANCE_CALLIGRAPHIC );
1099
1099
 
1100
1100
#ifdef DYNA_DRAW_VERBOSE
1101
1101
    g_print("[F&S:R=%c]", release?'T':'F');